LEADTOOLS Support
Imaging
Imaging SDK Examples
HOW TO: Use L_FeatherAlphaBlendBitmap to display 8bpp PNG images with alpha transparency
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, June 9, 2008 8:20:37 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
8bpp (or less than 8) PNG images can have a full alpha channel, but due to the way they are stored, it can be a little bit more difficult to display them in LEADTOOLS. The main image is still palettized just like a GIF would be. However, PNGs have another byte array in the file which can give an alpha value for each color in the main palette with values between 0 and 255. Therefore, if you wanted the alpha value of the 5th color in the palette, you would check the 5th entry in the transparency information. To get and set this information, you must use L_GetPNGTRNS and L_SETPNGTRNS. For an example specific to those functions, see:
http://support.leadtools.com/SupportPortal/cs/forums/17419/ShowPost.aspx
This example shows how to properly display an 8bpp PNG file with alpha information using L_FeatherAlphaBlendBitmap. The main difficulty is that you must manually construct the Alpha mask bitmap since L_GetBitmapAlpha only works on 16, 32, and 64 bit images.
LEADTOOLS Support
Imaging
Imaging SDK Examples
HOW TO: Use L_FeatherAlphaBlendBitmap to display 8bpp PNG images with alpha transparency
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.