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 |
|
|