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 create mask of current layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - May 31 2016 :  02:33:13  Show Profile  Reply
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

xequte

38947 Posts

Posted - May 31 2016 :  21:10:59  Show Profile  Reply
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
Go to Top of Page

yogiyang

India
727 Posts

Posted - Jun 01 2016 :  01:18:30  Show Profile  Reply
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
Go to Top of Page

xequte

38947 Posts

Posted - Jun 02 2016 :  00:23:31  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: