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
 Rotate and DeSelect Issue ?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

andyhill

Australia
153 Posts

Posted - Mar 01 2025 :  00:46:04  Show Profile  Reply
I am having issues, please advise where I have gone wrong - Thanks.


    ImageEnView.Proc.SaveUndo(ieuLayer);
    ImageEnView.LockUpdate;
    for i:= 0 to ImageEnView.LayersCount-1 do begin
      if ImageEnView.Layers[i].Selected then begin
        ImageEnView.Layers[i].Rotate:= 90;
      end;
    end; // for
    ImageEnView.LayersFixRotations(LYR_SELECTED_LAYERS);
    ImageEnView.UnlockUpdate;
    ImageEnView.Update();
    ImageEnView.Deselect();


1) Rotate has no effect ?

2) DeSelect still leaves Layers with Selected Marquee ?

Andy

xequte

38875 Posts

Posted - Mar 01 2025 :  19:16:17  Show Profile  Reply
Hi Andy

1. What sort of layers are they?

2. What MouseInteractLayers are active? There was an issue where deselect does not disable the layer point editing, but that is resolved in a recent beta. You might also try settings LayersCurrent to 0.



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

andyhill

Australia
153 Posts

Posted - Mar 02 2025 :  03:33:58  Show Profile  Reply
ielkPolyline (closed polygon)

MouseInteractLayers:= [mlMoveLayers]

Andy
Go to Top of Page

andyhill

Australia
153 Posts

Posted - Mar 02 2025 :  13:58:25  Show Profile  Reply
ALSO ImageEnView.Layers[i].Rotate:= 90; HAS NO EFFECT ???

Andy
Go to Top of Page

xequte

38875 Posts

Posted - Mar 02 2025 :  21:11:54  Show Profile  Reply
Hi Andy
Does this code work?

ImageEnView1.Layers[ ImageEnView1.LayersCurrent ].Rotate:= 45;
ImageEnView1.Update();

Are you able to reproduce that in any of demos?

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

andyhill

Australia
153 Posts

Posted - Mar 03 2025 :  12:10:26  Show Profile  Reply
NO, same, still does not work. I sent you my code earlier, off memory it is the last toolbar button

Andy
Go to Top of Page

xequte

38875 Posts

Posted - Mar 05 2025 :  22:15:27  Show Profile  Reply
Hi Andy

I added this code to a button in your demo:

ImageEnView.Layers[ ImageEnView.LayersCurrent ].Rotate:= 45;
ImageEnView.Update();

It worked fine for me:



Are you using an older version of ImageEn?

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

andyhill

Australia
153 Posts

Posted - Mar 05 2025 :  23:37:50  Show Profile  Reply
Why has rotation changed polygon size ?
The original bounding box has constrained the size of the polygon in the rotation.

I need true rotation eg. example above the original layer w=10/h=20, rotate 90 the layer needs to become w=20/h=10


Andy
Go to Top of Page

andyhill

Australia
153 Posts

Posted - Mar 05 2025 :  23:49:46  Show Profile  Reply
Also, 45 rotates contents within bounding box distorting the size but 90 fails in my version.

TEST: Create a portrait rectangle polygon say (100, 100), (300, 100), (300, 600), (100, 600) close; Now rotate to landscape 90 Degrees, my version does not work.

Andy
Go to Top of Page

xequte

38875 Posts

Posted - Mar 06 2025 :  16:22:21  Show Profile  Reply
Hi Andy

Rotating a polyline layer only rotates the points. It does not change the size of the layer. For this reason a rectangle rotated 90 degrees will look the same.

If the aspect ratio should be retained, then should update the width/height based on the amount of rotation (see IECalcRotatedBitmapSize() in hyieutils.pas.

Of course, that will work with simple shapes like rectangles, but fail with others, e.g. a diamond rotated 45 degrees need to get a smaller bounding box, not a larger one.


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: