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 set transparency for an image?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

wolf2009cn

2 Posts

Posted - Jun 03 2023 :  21:34:15  Show Profile  Reply
I am trying to set the transparency of a PNG image to 50%, but the code above doesn't work. Could you please tell me how to write the correct code? thanks.

ImageEnView1.IEBitmap.AlphaChannel.Fill(128);

xequte

38615 Posts

Posted - Jun 05 2023 :  02:10:57  Show Profile  Reply
Hi

That looks correct. Did you call ImageEnView1.Update() afterwards?

If you manipulated the bitmap directly you must call Update to show the changes in the TImageEnView.

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

wolf2009cn

2 Posts

Posted - Jun 05 2023 :  10:34:13  Show Profile  Reply
I have found some methods called 'Update' in IEBitmap. I am using Delphi 7.0 with ImageEn 5.2, and I would like to set the transparency of an image. Could you please tell me how to write the code to achieve this?


ImageEnView1.IEBitmap.AlphaChannel.Fill(128);
ImageEnView1.Update();
//ImageEnView1.IO.Update;
Go to Top of Page

xequte

38615 Posts

Posted - Jun 06 2023 :  03:10:11  Show Profile  Reply
Hi

5.2.0 is quite an old version now, so I may not be recalling a difference in that version, but your code above should work.

You can also use:

ImageEnView1.Proc.AlphaFill( 128 );

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

Also ensure ImageEnView1.EnableAlphaChannel is set to true:

http://www.imageen.com/help/TImageEnView.EnableAlphaChannel.html

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