blob: c645144ca57db41162fe0a8f4d4f59cbc941847b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//! [0]
QImageReader reader;
reader.setFormat("png"); // same as reader.setFormat("PNG");
//! [0]
//! [1]
QImageReader reader("image.png");
// reader.format() == "png"
//! [1]
//! [2]
QImage icon(64, 64, QImage::Format_RGB32);
QImageReader reader("icon_64x64.bmp");
if (reader.read(&icon)) {
// Display icon
}
//! [2]
//! [3]
QImageReader reader(":/image.png");
if (reader.supportsOption(QImageIOHandler::Size))
qDebug() << "Size:" << reader.size();
//! [3]
|