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 scale Vector Objects based on Layer 0 Img?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Oct 28 2016 :  08:38:38  Show Profile  Reply
Hello,

In a software I am using ImageEnVect.

In the software the user will be allowed to add vector shapes of type iekBOX only. These shapes can be of different size and arranged in a manner required by user.

Now the user wants to be able to change/load the background image (in layer 0).

Depending on the size of the loaded image the shapes created by the users should also scale up or down maintaining the layout and proportions.

I am attaching an image for better understanding.

Insert Image:

In this image if you observe the shapes in color are the objects of iekBox added by user and the big box around them is the background image size that the user has loaded.

Now these boxes should automatically enlarge themselves maintaining their current layout/arrangement and proportion of Object Extent (the bounding rectangle of all vectorial objects) to fit the background.

I tried to selecting all objects and resizing them interactively with mouse. This does work and the objects get resized but objects position stays the same.

How can we achieve this programmatically.

Is there any way to scale/resize selected objects programmatically just like the function for rotating all objects (RotateAllObjects)?

This is what I want to achieve.


All help is welcome.

TIA


Yogi Yang

xequte

38616 Posts

Posted - Oct 30 2016 :  04:01:19  Show Profile  Reply
Hi

This would be fairly easy. Just iterate through all the objects multiplying PosX, PosY, Width and Height by NewSize/OldSize.



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

yogiyang

India
727 Posts

Posted - Nov 05 2016 :  12:44:18  Show Profile  Reply
Hello Nigel,

Thanks for the tip. I have already worked that out but actually I was expecting ImageEnVect to work properly when a user selected multiple objects and scales them interactively. Which it is not working.

TIA


Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Nov 07 2016 :  15:46:02  Show Profile  Reply
Hi Yogi

No, that is not presently an option. We'll look into it in a future update.

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: