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
 Obj Top and Left after Rotation

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