PNG's and GDI+
-
hi friends, i have a small problem, i just want to know how to differentiate between the png images which are having some transparent area and which are without transparent area. Can this be a solution: "pixel by pixel scan the image and check the alpha value of each pixel" Is there any other way of handling the same. i am using GDI+ for the above. Thanking in Advance Samir Satardekar
-
hi friends, i have a small problem, i just want to know how to differentiate between the png images which are having some transparent area and which are without transparent area. Can this be a solution: "pixel by pixel scan the image and check the alpha value of each pixel" Is there any other way of handling the same. i am using GDI+ for the above. Thanking in Advance Samir Satardekar
Hi Samir, The PNG image has an image header called the IHDR chunk. It contains a single BYTE 'Color Type' value and will be 4 or 6 if the PNG image supports alpha transparency. You can either read this value manually or use GDI+ to read this value. The Image::GetFlags method[^] will return a ImageFlagsHasAlpha value[^] if the image supports transparency. Best Wishes, -David Delaune
-
Hi Samir, The PNG image has an image header called the IHDR chunk. It contains a single BYTE 'Color Type' value and will be 4 or 6 if the PNG image supports alpha transparency. You can either read this value manually or use GDI+ to read this value. The Image::GetFlags method[^] will return a ImageFlagsHasAlpha value[^] if the image supports transparency. Best Wishes, -David Delaune