ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Transparent Background: TIF vs. PNG
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Fellafoo

USA
44 Posts

Posted - May 03 2022 :  06:33:35  Show Profile  Reply
Is there something unique I need to handle when reading a TIF file?

For example...

      IsTransparent := False;
      ieBmp := TIEBitmap.Create;
      ieBmp.Read(ImgFName);
      IsTransparent := ieBmp.HasAlphaChannel;

When I read the attached TIF file, IsTransparent is True;

However, when I pass it to...

ieBmp.RenderToCanvasWithAlpha(ieCnv.GDICanvas, pxTL.X, pxTL.Y, pxWd, pxHt, 0, 0, ieBmp.Width, ieBmp.Height, 255, rfFastLinear, ielNormal, 1);

The background is not transparent. PNG files have been working as expected.

Thank You,

MFM

attach/FELLAFOO/20225363236_8ARMMAR0.TIF

xequte

38176 Posts

Posted - May 03 2022 :  21:35:45  Show Profile  Reply
Hi

This image contains an alpha channel, even though it is not used. You should validate the alpha channel:

  IsTransparent := ieBmp.HasAlphaChannel( True );


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Fellafoo

USA
44 Posts

Posted - May 04 2022 :  08:03:59  Show Profile  Reply
OK thanks, I'm guessing these images were intended to have black set as the transparent color.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: