Hello guys :)

Recently I've downloaded the PNGlib and I'm very glad about this lib. But I need to display png images with transparent parts. If I display transparent images I get a light blue insted of the lucent pixel. I found no option to replace the transparent pixels to another one (for example the application background) so that it seem it would be lucent. Is there any possebility to get the palette entry of the lucent pixels?

:( Regards, Marwin
Posted on 2003-03-08 12:43:22 by Marwin
Take a look at Qweerdy's PngSkin examples.
Posted on 2003-03-08 12:59:30 by bitRAKE
This is not what I'm searching for, bitRAKE. It has to be a fast way because I'm using the images in an ownerdraw menu. But some of them have lucent parts. I've attached an example of how it should look like. :( :(
Posted on 2003-03-08 13:45:09 by Marwin
IIRC there is a PNG chunk "tRNS" that - for indexed color images - contains a list of alpha values, at most one for each palette entry (but may be less than the number of entries). However this chunk isn't parsed by PNGlib..
Using the alpha channel is easier, but requires the images to be 32-bit. What about using a default color (like 0xFF00FF) for the pixels that need to be transparent and not using the transparency options of your imaging program?

Posted on 2003-03-08 14:01:41 by Thomas
Hm, it's a good alternative Thomas. But can I replace all the pixels with e.g. 0xFF00FF? Is there a API function which can do so?

Posted on 2003-03-08 14:35:18 by Marwin
IMHO, it is better to use 32-bit images. Otherwise, you'll need to handle it like the toolbar transparency (several threads here about this topic).
Posted on 2003-03-08 14:46:50 by bitRAKE
Marwin: you could find all the 0xFF00FF's in the bitmap's pallette and change them to the background color of your menu.

Posted on 2003-03-08 14:57:50 by Thomas
I've done it this way now:

Posted on 2003-03-09 11:43:26 by Marwin
You can access the bitmap data directly, Qweerdy does it in his PNGskin example.

Posted on 2003-03-09 12:18:34 by Thomas