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
 How to determine that an image is fully transparent?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

papa.john

9 Posts

Posted - Aug 19 2023 :  01:30:19  Show Profile  Reply
Is there some non-visual component or function that can be used to determine that an image (icon) is fully transparent?

xequte

38613 Posts

Posted - Aug 19 2023 :  23:45:06  Show Profile  Reply
Hi

You can use:

  bmp := TIEBitmap.Create();
  try
    bmp.Read( 'D:\Alpha2.png' );
    if bmp.HasAlphaChannel(True) and bmp.AlphaChannel.IsAllBlack() then
      ShowMessage( 'Image is completely transparent' )
    else
      ShowMessage( 'Image NOT transparent' );
  finally
    bmp.free;
  end;


Also see:

http://www.imageen.com/help/TImageEnProc.CalcImageTransparency.html


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: