DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to find the rotation direction(TRotateImage)

 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
Donnie
Member


Joined: 10 Sep 2006
Posts: 2

PostPosted: 10/09/06 13:25    Post subject: How to find the rotation direction(TRotateImage) Reply with quote

I am using the RotateImage Component for my program. It is useful and powerful component for dealing with a picture. But a problem occured in these days. I don't know how to find the status of the rotation (CW or CCW) when the picture is operated. Can you give me some advice about it?
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 11/09/06 09:51    Post subject: Reply with quote

Increasing angle, rotates the image in CCW.
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Donnie
Member


Joined: 10 Sep 2006
Posts: 2

PostPosted: 11/09/06 10:19    Post subject: Reply with quote

I think it is difficult to know the direction if you just compare the original angle to the new angle (refer to below programe). You know the minus and plus value will be occured. Maybe, I don't understand your meaning very well. Could you explain it in detail for me. Thanks a lot.

if Dragging then
begin
if X = RotateImage1.Width / 2 then
if Y < RotateImage1.Height / 2 then
Theta := Pi / 2
else
Theta := -Pi / 2
else
Theta := ArcTan2(Y - RotateImage1.Height / 2, X - RotateImage1.Width / 2);
Angle := StartAngle + 180 * (StartTheta - Theta) / Pi;
TrackBar1.Position := Trunc(Angle * 10) mod 3600;
TrackBar1Change(Self);
end;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group