Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, June 9, 2008 8:20:37 AM(UTC)

GregR  
GregR

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.
File Attachment(s):
API-v15-8bppPNGFeatherAlphaBlend.zip (15kb) downloaded 61 time(s).
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.042 seconds.