Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

HOW TO: Use L_FeatherAlphaBlendBitmap to display 8bpp PNG images with alpha transparency
Started by GregR at 06-09-2008 13:25. Topic has 0 replies.

Print Search « Previous Thread Next Thread »
  06-09-2008, 13:25
GregR is not online. Last active: 8/28/2008 9:22:32 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,527
HOW TO: Use L_FeatherAlphaBlendBitmap to display 8bpp PNG images with alpha transparency

Attachment: API - v15 - 8bpp PNG FeatherAlphaBlend.zip
Reply Quote
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.

Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Image Processin... » HOW TO: Use L_FeatherAlphaBlendBitmap to display 8bpp PNG images with alpha transparency

Powered by Community Server, by Telligent Systems