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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to set transparency for an image?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
wolf2009cn Posted - Jun 03 2023 : 21:34:15
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);
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 06 2023 : 03:10:11
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
wolf2009cn Posted - Jun 05 2023 : 10:34:13
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;
xequte Posted - Jun 05 2023 : 02:10:57
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