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
 ImageEnVect.SetViewXYSmooth for rotated objects
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndyColmes

USA
351 Posts

Posted - Feb 16 2016 :  05:07:15  Show Profile  Reply
I use the following code to automatically locate the object into view. This works perfect if the object is not rotated. Once I have performed a RotateAllObjects,the code does not seem to show the object correctly. How do I modify the code to handle rotated objects?

l := ImageEnVect1.ObjLeft[0];
t := ImageEnVect1.ObjTop[0];

xx:=trunc( l * (ImageEnVect1.Zoom/100) );
yy:=trunc( t * (ImageEnVect1.Zoom/100) );
ImageEnVect1.SetViewXYSmooth( xx-5, yy-5 );

Thanks in advance.

Andy

xequte

38947 Posts

Posted - Feb 18 2016 :  16:56:49  Show Profile  Reply
Hi Andy

There is a limitation here due to the way returns object positions. We are investigating a solution.

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

xequte

38947 Posts

Posted - Feb 22 2016 :  16:29:27  Show Profile  Reply
Hi Andy

TImageEnVect allows for ObjLeft > ObjRight and ObjTop > ObjBottom to handle line drawing (know which way the line is pointing (TR->BL or TL->BR).

So please change your code as follows:

ImageEnVect1.GetObjRect( 0, aRect );
l := imin( aRect.Left, aRect.Right ) ;
t := imin( aRect.Top, aRect.Bottom ) ;

xx:=trunc( l * ( ImageEnVect1.Zoom / 100 ));
yy:=trunc( t * ( ImageEnVect1.Zoom / 100 ));
ImageEnVect1.SetViewXYSmooth( xx - 5, yy - 5 );




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

AndyColmes

USA
351 Posts

Posted - Apr 01 2016 :  11:31:45  Show Profile  Reply
Hi Nigel,

Thanks for the code and sorry for the late reply.. I will give it a spin and report back..

Thanks again.

Andy
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: