09-09-2013 12:55 PM
Do you need the extra step or are you happy to just load directly from source?
QString appFolder(QDir::homePath()); appFolder.chop(4); QString src=appFolder + "app/native/assets/images/image.png"; QImage img(src);
09-09-2013 08:24 PM
09-09-2013 08:37 PM - edited 09-09-2013 08:40 PM
I don't know how to extract ImageData from Image. But if you have access to ImageData, it has format() and pixels() methods which give access to raw image data.
QImage can load BMP files, so it should be possible to prepend the bitmap header to that data and feed it into QImage:
QImage image = QImage::fromData(data, "BMP");
There's a sample project by @slashkyle which shows how to append BMP header to raw screenshot data -
I didn't investigate if the image data should be additionally transformed or is in the proper format as is.