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
 Make layer moveable/sizeable again
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

132 Posts

Posted - Jul 10 2019 :  11:06:51  Show Profile  Reply
I create a textlayer using:

function LayersAdd(Text: String; FontSize : Integer; FontColor : TColor; FontName : string; FontStyle : TFontStyles = []; PosX: Integer = -1; PosY: Integer = -1): integer; overload;

Later on this layer may be moved or resized manually. Thus I identify the layer with a unique layer name (ULN):

for i := 0 to ImageEnView1.LayersCount - 1 do
    ln := CompareStr(ImageEnView1.Layers[i].Name, ULN);
  if ln = 0 then
    begin
      idx := ImageEnView1.LayersNameToIndex(ULN, False);
      ImageEnView1.LayersCurrent := idx;
    end;


and set the mouse interact layer options:

ImageEnView1.LayerOptions := ImageEnView1.LayerOptions + [ loAllowMultiSelect, loAutoSelectMask ];
ImageEnView1.MouseInteractLayers := [ mlMoveLayers, mlResizeLayers ];

As result, the layer is selected correctly with the eight yellow circles but is neither moveable nor sizeable. The only operation which is allowed is the creation of new layers inside the layer area.

May you give me a hint what I'm missing?

Al

xequte

38610 Posts

Posted - Jul 10 2019 :  19:44:03  Show Profile  Reply
Hi Al

I cannot reproduce that. Ensure you call ImageEnView1.LayersDeselectAll(); before setting LayersCurrent to clear the existing selection.

Are you able to reproduce in our Layer editing demos?


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

132 Posts

Posted - Jul 11 2019 :  04:23:20  Show Profile  Reply
Hi Nigel,

behaviour doesn't change using ImageEnView1.LayersDeselectAll();

I just tried "Rotate Layers Demo" which works fine but it is limited in calling the parameters, same thing my code does. I'll try to simplify my code and continue to dig to find the cause.

PS: "Rotate Layers Demo" contains an error. Both procedures, Move and Rotate, use the same parameters [ mlMoveLayers, mlResizeLayers ]. You should modify the ones in the Rotate procedures in [ mlMoveLayers, mlRotateLayers ].

Al
Go to Top of Page

aleatprog

132 Posts

Posted - Jul 13 2019 :  09:37:40  Show Profile  Reply
Hi Nigel,

the error should've been caused by wrong MouseInteractLayers parameters. I solved it by resetting the parameters using ImageEnView1.MouseInteractLayers := [] as shown in the Layers demo.

Thank you,
Al
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: