Have a look at QImageIOHandler::ImageOption, in specific QImageIOHandler::ScaledSize and QImageIOHandler::supportsOption().
{
...
bool supportsOption ( ImageOption option )
{
if(option==ScaledSize)
return true;
...
}
{
QSize scaledSize
= option
(ScaledSize
).
toSize();
...
}
};
class MyImageHandler : public QImageIOHandler
{
...
bool supportsOption ( ImageOption option )
{
if(option==ScaledSize)
return true;
...
}
bool read ( QImage * image )
{
QSize scaledSize = option(ScaledSize).toSize();
...
}
};
To copy to clipboard, switch view to plain text mode
reader.
setScaledSize(QSize(64,
64);
if (reader.read(&icon)) {
// Display icon
}
QImage icon(64, 64, QImage::Format_RGB32);
QImageReader reader("XXX.abc");
reader.setScaledSize(QSize(64,64);
if (reader.read(&icon)) {
// Display icon
}
To copy to clipboard, switch view to plain text mode
Bookmarks