ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 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?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Sep 22 2017 : 00:43:00
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
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 24 2017 : 01:22:05
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
yogiyang Posted - Sep 23 2017 : 02:29:01
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
xequte Posted - Sep 22 2017 : 17:39:39
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
klausdoege Posted - Sep 22 2017 : 12:49:47
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