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 unlink normal layer and mask layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Jun 16 2016 :  05:14:37  Show Profile  Reply
Hello,

I have set LayerOptions to loAllowMultiSelect and loAutoSelectMask. This will automatically select Mask Layer when we select a normal layer. This is just fine.

But under some situations I would want to prevent ImageEn from selecting the Mask Layer. Like for example when a user presses Ctrl Key and clicks on a Layer the mask layer if associated with that layer should not get selected so when the user moves or resizes layer the mask should not move or resize with it.

Is it possible to do this?

If Yes then any ideas as to how to do this please.

TIA


Yogi Yang

xequte

38194 Posts

Posted - Jun 16 2016 :  18:48:28  Show Profile  Reply
Hi Yogi

Using the OnLayerNotify event you should be able to detect the selection of the mask layer and immediately deselect it:

http://www.imageen.com/help/TIELayerNotify.html


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

yogiyang

India
725 Posts

Posted - Jun 17 2016 :  11:09:13  Show Profile  Reply
Hello,

This code is not deselecting the mask layer.

if (layer > 0) and (layer < (ievMain.LayersCount - 1)) then
  begin
      if ievMain.Layers[layer + 1].IsMask then
      begin
        ievMain.Layers[layer + 1].Selectable := False;
      end;
  end;


I am saying this because when I move or resize an Image the mask is also getting resized!

TIA


Yogi Yang
Go to Top of Page

xequte

38194 Posts

Posted - Jun 19 2016 :  20:15:42  Show Profile  Reply
Hi Yogi

The "Selectable" property is ignored if you have enabled loAutoSelectMask.

You are better to disable loAutoSelectMask and automatically select the layer mask yourself when the user clicks a layer.


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: