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
 ieVect Objects, Select, set Center point, Distort

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
andyhill Posted - Apr 26 2016 : 22:46:57
I have many ieVect Objects, I want to select them via code (this returns a select rectangle).

I want to setup a new reference Center Point in code for the new select rectangle.

I now want to stretch/distort the selected objects based on my new select rectangle reference Center Point and my new select rectangle handle point (in this case bottom/right) position.

I want to do this all in code, please advise - thanks in advance.



Andy
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 03 2016 : 22:03:51
Hi Andy

You would need to iterate through the points of the polygon, using:

www.imageen.com/help/TImageEnVect.ObjPolylinePoints.html

Building a new array, adjusted to handle the distortion, and then set the new array using:

http://www.imageen.com/help/TImageEnVect.SetObjPolylinePoints.html


Unfortunately there are no methods in ImageEn to handle this kind of distortion, you would need to code something yourself. I imagine it would work something like:

1. Get Point X, Y
2. If X <= Center_X do nothing, else scale X by New_Width - Center_X / Old_Width - Center_X
3. If Y <= Center_Y do nothing, else scale Y by New_Height - Center_Y / Old_Height - Center_Y
Note: This assumes a bottom, right distortion, obviously you would also need to handle negative distortions

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
andyhill Posted - Apr 27 2016 : 16:37:37
I should have advised that all the objects are polygons

Andy
andyhill Posted - Apr 26 2016 : 22:50:13




Andy