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 create mask of current layer

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
yogiyang Posted - May 31 2016 : 02:33:13
Hello,

I want to allow a user to select a layer.

Once the layer is selected I want to create a mask which should has the shape of the current layer's contents. And the mask should be linked to the layer so that if the user resizes the layer the mask layer should also resize along with it.

Please guide as to how to do this?

TIA


Yogi Yang
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 02 2016 : 00:23:31
Hi Yogi

If you only want black or white then convert to black and white, e.g. using ConvertTo24Bit, then set the Layers[ x ].Bitmap.PixelFormat := ie8g;

It should not set LegacyBitmap to true. Have you tested it?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
yogiyang Posted - Jun 01 2016 : 01:18:30
Thanks Nigel,

Thanks for your reply.

Do you mean to say that I should copy the layer's content to another layer and convert it to mask?

If I do this then the mask will be uneven. I need even color in the mast which is either black or white nothing in between.

 
The mask image will need to be ie8g. So you will probably need to convert the layer bitmap.

How can I convert a layer to ie8g?

If I use this: ImageEnView1.Proc.ConvertTo(ie8p, ieptFixedHalftone256, iedtOrdered8x8);
then will the LegacyBitmap become true? I want to keep LegacyBitmap properly to false always as the images the software has to work with are very large in size.

TIA


Yogi Yang
xequte Posted - May 31 2016 : 21:10:59
Hi Yogi

You can use the IsMask property to make a layer into a mask:

http://www.imageen.com/help/TIELayer.IsMask.html


The mask image will need to be ie8g. So you will probably need to convert the layer bitmap.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com