Home > Back-end >  Questions about TPaintBox TImage picture mobile below
Questions about TPaintBox TImage picture mobile below

Time:10-17

I loaded the contents on the graphics (JPG), but don't want to draw something on the images (also not let), so in the above plus a layer, namely the TImage or TPaintBox controls, on top of the TImage have pictures in this way, will see the image below content, and does not affect the following things in the above picture, but, as a result, mobile nowadays the images move quickly, not topped with a layer of, is very good, why?

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
  • Related