可以单独做一个Form,放一个Image设定
Form2.WindowsState:=wsMaximized;
Image1.Align:=alClient;
Image1可以这样赋值 Image1.Picture.Assign(Image.Picture);var
MouseDownPoint,MouseMovePoint :TPoint;
IsMouseDown :Boolean;procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button=mbLeft then
begin
IsMouseDown :=True;
MouseDownPoint :=Point(x,y);
end;
end;procedure TForm2.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if IsMouseDown then
begin
MouseMovePoint :=Point(x,y);
Form2.HorzScrollBar.Position:=Form2.HorzScrollBar.Position+MouseDownPoint.x-MouseMovePoint.x;
Form2.VertScrollBar.Position :=Form2.VertScrollBar.Position+MouseDownPoint.y-MouseMovePoint.y;
end;
end;procedure TForm2.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
IsMouseDown :=False;
end;
Form2.WindowsState:=wsMaximized;
Image1.Align:=alClient;
Image1可以这样赋值 Image1.Picture.Assign(Image.Picture);var
MouseDownPoint,MouseMovePoint :TPoint;
IsMouseDown :Boolean;procedure TForm2.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button=mbLeft then
begin
IsMouseDown :=True;
MouseDownPoint :=Point(x,y);
end;
end;procedure TForm2.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if IsMouseDown then
begin
MouseMovePoint :=Point(x,y);
Form2.HorzScrollBar.Position:=Form2.HorzScrollBar.Position+MouseDownPoint.x-MouseMovePoint.x;
Form2.VertScrollBar.Position :=Form2.VertScrollBar.Position+MouseDownPoint.y-MouseMovePoint.y;
end;
end;procedure TForm2.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
IsMouseDown :=False;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货