T O P I C R E V I E W |
AndyColmes |
Posted - May 06 2012 : 22:49:51 After calling RotateAllOBjects, the ObjTop and ObjLeft are no longer the same. I use the following code to show and bring the object into view:
xx:=trunc( ImageEnVect1.ObjLeft[0] * (ImageEnVect1.Zoom/100) ); yy:=trunc( ImageEnVect1.ObjTop[0] * (ImageEnVect1.Zoom/100) ); ImageEnVect1.SetViewXY( xx-5, yy-5 );
But since the ObjLeft and ObjTop is not correct, it is showing correctly. How do I get the correct ObjLeft and ObjTop after calling RoateAllObjects?
Thanks.
|
2 L A T E S T R E P L I E S (Newest First) |
AndyColmes |
Posted - May 07 2012 : 08:14:23 I was able to solve it by the following code:
if (Length(rt)>0) then begin //there's rotation if (rt='90') then begin t := ImageEnVect1.ObjTop[0] - ImageEnVect1.ObjHeight[0]; l := ImageEnVect1.ObjLeft[0]; end else if (rt='180') then begin l := ImageEnVect1.ObjLeft[0] - ImageEnVect1.ObjWidth[0]; t := ImageEnVect1.ObjTop[0] - ImageEnVect1.ObjHeight[0]; end else if (rt='270') then begin l := ImageEnVect1.ObjLeft[0] - ImageEnVect1.ObjWidth[0]; t := ImageEnVect1.ObjTop[0]; end; end else begin l := ImageEnVect1.ObjLeft[0]; t := ImageEnVect1.ObjTop[0]; end;
xx:=trunc( l * (ImageEnVect1.Zoom/100) ); yy:=trunc( t * (ImageEnVect1.Zoom/100) ); ImageEnVect1.SetViewXY( xx-5, yy-5 );
|
AndyColmes |
Posted - May 06 2012 : 23:37:12 I am actually using LoadFromFileIEV for the objects. After changing the rotation using RotateAllObjects and saving/loading the .iev file, the ObjTop and ObjLeft is no longer valid.
Thanks.
|