PDA

View Full Version : Showing 1 bit binary PNG as 32bit RGBA image



Charvi
19th October 2015, 07:50
Hi,

I have a 1 bit binary png which needs to be shown on the GUI as 32 bit RGBA. I have done the loading of the image in a QImage and then converting the format. How to multiply the 1 bits with a color and keep the 0's as transparent ?

Thanks,
Charvi

anda_skoa
22nd October 2015, 18:11
Iterate over QImage::bits(), multiply. Transparent pixels have 0 as their alpha channel value, multiplying won't change that.

Cheers,
_