How to open image in RGB32 mode [SOLVED]
-
I'm trying to open an image like follows:
Qimage image("/home/john/pic.png", QImage::Format_RGB32);
But it gives me an error :
no matching function call to QImage::QImage(const char [], QImage::Format);
The reason I'm asking is that my picture being processed as greyscale or 8bit or whatever, but not colored as I need. Look at the 3rd comment in this question: http://stackoverflow.com/questions/31163679/how-to-make-gaussian-blur-work-properly
-
Hi,
If I understand you correctly, you have an unusual png formatted image ?
-
@SGaist as I figured out there was no problem in image, but in my code. Anyway, thanks. I'll mark it as solved.
-
Was the problem only the wrong constructor called ?
-
@SGaist I tried to change the complete logic of my app so I wasn't needed in constr like this, but picture was still colorful and this because I don't think I was ever needed to construct image in that way. Maybe
Qt
takes an advantage of guessing what picture looks like on itself? -
There's no guessing, Qt will load your image with the corresponding plugin which uses the usual libraries to manipulate the images (libpng, libjpeg etc.). Then IIRC there might be a conversion to a format suited for display e.g. ARGB32.