Ver Mensaje Individual
  #1  
Antiguo 15-03-2008
Avatar de ZayDun
ZayDun ZayDun is offline
Miembro
 
Registrado: mar 2007
Posts: 129
Reputación: 20
ZayDun Va por buen camino
Question Moviendo imagenes con el raton

Hola, estoy intentando hacer que una imagen se mueve con el raton, tengo el codigo pero no me termina de convencer ya que la imagen se mueve una vez he soltado el boton del raton, y lo que yo quiero es que la imagen siga al raton hasta que yo lo suelte. aqui dejo el codigo que utilizo por si se le puede agregar algo para mejorarlo o mejor otro metodo. saludos! y gracias.


Código Delphi [-]
procedure TForm1.o10MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var OrgFormPoint, CurCursorPoint, OrgCursorPoint: TPoint;
begin
OrgFormPoint.X := o10.Left;
OrgFormPoint.Y := o10.Top;
GetCursorpos(OrgCursorPoint);
While (GetAsyncKeystate(VK_LBUTTON) <> 0) do
begin
GetCursorpos(CurCursorPoint);
o10.Left := OrgFormPoint.X - OrgCursorPoint.X + CurCursorPoint.X;
o10.Top := OrgFormPoint.Y - OrgCursorPoint.Y + CurCursorPoint.Y;
end;
Responder Con Cita