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
 Transparency for a layer restricted to a selection
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Nov 03 2011 :  08:17:13  Show Profile  Reply
I know I can adjust the transparency for a layer, but can I restrict it only to a selection if a selection exists?

fab

1310 Posts

Posted - Nov 04 2011 :  07:24:48  Show Profile  Reply
There are two ways:
1 - create a layer mask (a 8 bit gray scale bitmap which specifies the upper layer transparency, pixel by pixel)
2 - change the alpha channel of the bitmap

For example (2):
// set transparency of selected area = 50
ImageEnView1.SetSelectedAreaAlpha(50);
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Nov 07 2011 :  12:01:09  Show Profile  Reply
Thanks Fabrizio. Do you have a demo project on how this is done? I am not sure how to create a layer mask using the bitmap.
Go to Top of Page

fab

1310 Posts

Posted - Nov 08 2011 :  00:49:03  Show Profile  Reply
The demo at ImageEditing\Layers shows several layer related features (included layer mask).
About the way nr.2, just execute the code shown.
Go to Top of Page

AndyColmes

USA
351 Posts

Posted - Nov 08 2011 :  08:45:40  Show Profile  Reply
Thanks Fabrizio. I will give it a try.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: