radenf,
Revisa este link:
Revisa este código:
Código Delphi
[-]
procedure TForm1.Timer1Timer(Sender: TObject);
begin
RotateImage1.Angle := Frac((RotateImage1.Angle + 1.0) / 360.0) * 360.0;
end;
procedure TForm1.RotateImage1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
DraggingControl := nil;
if (Button = mbLeft) and not (ssDouble in Shift) then
DraggingControl := TRotateImage(Sender);
if Sender = DraggingControl then
begin
StartAngle := RotateImage1.Angle;
if X = DraggingControl.Width / 2 then
if Y < DraggingControl.Height / 2 then
StartTheta := Pi / 2
else
StartTheta := -Pi / 2
else
StartTheta := ArcTan2(Y - DraggingControl.Height / 2, X - DraggingControl.Width / 2);
end;
end;
procedure TForm1.RotateImage1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
var
Theta: Extended;
begin
if Sender = DraggingControl then
begin
if X = DraggingControl.Width / 2 then
if Y < DraggingControl.Height / 2 then
Theta := Pi / 2
else
Theta := -Pi / 2
else
Theta := ArcTan2(Y - DraggingControl.Height / 2, X - DraggingControl.Width / 2);
RotateImage1.Angle := StartAngle + 180 * (StartTheta - Theta) / Pi;
end;
end;
procedure TForm1.RotateImage1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
DraggingControl := nil;
end;
El código anterior fue tomado del ejemplo que viene con el
Componente TRotateImage mencionado en el link y muestra como calcular el angulo de rotación de una imagen, quizás puedas adaptar el ejemplo a tu aplicación de imágenes en formato .dcm
Espero sea útil
Nelson.