0

Does anyone know how to convert 32 bit images to show on device with 16 bit display ?

I tried to create a 24 bit image with Qt QImage - QImage QImage::convertToFormat

and save the result image, but the image I got was also 32 bit (I see the this data in the properties of the output image - Bit Depth)

user1335880
  • 81
  • 2
  • 8

1 Answers1

0

If all you want is to display the image, there's no need to convert it yourself. Just show it with any of the Qt widgets capable of displaying QImage (or QPixmap). Qt should handle the conversion on the fly.

If you need to touch the pixel data yourself, the format you are looking for may be QImage::Format_RGB16 but you have to make sure the bits layout (RGB565) is what you want.

Stephen Chu
  • 12,724
  • 1
  • 35
  • 46
  • I want to see the image on 16 bit before I put this on the device, but the problem is that when I use the QImage::convertToFormat function it affect the image only in run time, also when I try to save the result, it save the original image and not the image after change... – user1335880 Aug 01 '12 at 05:29
  • QImage::convertToFormat() doesn't change the QImage itself. It returns a copy of the converted QImage. Save that one instead. – Stephen Chu Aug 01 '12 at 14:24