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 resize and align a group of layes in code?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
725 Posts

Posted - Sep 22 2017 :  00:43:00  Show Profile  Reply
Hello,

In a multi layer situation I have a need to resize the background (Layer 0) to a new size and resize multiple user selected layers proportionally to a size entered by user without spoiling the arrangement between selected layers.

For example there are three layers - Layer 0, 1 & 2.

Now the user will reduce the size of Layer 0 by entering its size in provided interface. Once the size of Layer 0 set the user will select the Layers 1 & 2 and enter a new size in the provided interface. These Layers 1 & 2 should be first resized to the entered width and height as a group (one single virtual object) and automatically aligned to the center of Layer 0 maintaining the arrangement between Layers 1 & 2.

I have tried to use the functions:
- LayersRepositionAll
- LayersAlign
- LayersSizeAll (this only works with percentage so probably I am not able to use it properly as the users are entering absolute width and height values)

TIA



Yogi Yang

klausdoege

Germany
389 Posts

Posted - Sep 22 2017 :  12:49:47  Show Profile  Reply
Hi Yogi,
maybe you can use this:
// Enlarge all layers vertically and horizontally by 10 pixels
ImageEnView.LayersRepositionAll( 10, 10, False, True );


Klaus
www.klausdoege.de
Go to Top of Page

xequte

38196 Posts

Posted - Sep 22 2017 :  17:39:39  Show Profile  Reply
Hi Yogi

For complex movement like this, you should just iterate through the layers setting PosX, PosY, Width and Height.




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

yogiyang

India
725 Posts

Posted - Sep 23 2017 :  02:29:01  Show Profile  Reply
Klaus & Nigel,

Thanks for your hints.

Actually I was hoping that there was such a function as if a user interactively Resizes multiple selected layers they all get resized properly and also relocated as expected.

TIA


Yogi Yang
Go to Top of Page

xequte

38196 Posts

Posted - Sep 24 2017 :  01:22:05  Show Profile  Reply
Hi Yogi

If they are grouped, then when resizing they will be sized en masse:

https://www.imageen.com/help/TIELayer.GroupIndex.html

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: