Below:
Only when a TImage mobile: including: b_move, i_x, i_y is added in TForm1 private variables,
//handle the mouse events
Procedure TForm1. Image1MouseDown (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
The begin
B_move:=true;
I_X:=X;
I_Y:=Y;
end;
Procedure TForm1. Image1MouseUp (Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
The begin
MoveFlag:=False;
end;
Procedure TForm1. Image1MouseMove (Sender: TObject; Shift: TShiftState; X,
Y: Integer);
The begin
If b_move then
The begin
Image1. Left:=Image1. Left + (X - i_X);
Image1. Top:=Image1. Top + (Y - i_Y);
end;
end;
Such as added layer, the layer function of the three events of the same, take with Image1
CodePudding user response:
I have been solved,CodePudding user response:
Congratulations to LZ to solve the
CodePudding user response:
Lu had pick up points