Вопрос

Why can't I load this png into my QPixmap? Open street map png

Q_ASSERT(fakeMap.load("C:/map71.png"));

This renders an ASSERT.

Does not render an ASSERT if I open it in MS paint and re saves it either as a jpeg or png (but larger in size). Same path and syntax.

Это было полезно?

Решение

The image you link to is actually a JPEG. If I save it with the jpg extension it loads into Qt ok. Qt is probably trying to treat it as a PNG and that's why it's failing.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top