帮我看看代码,当我缩小或者放大图象以后,为什么总是闪烁,怎么能消除闪烁??????(icehill)
{--------------------------------Move the picture------------------------------------------}
procedure TForm_3011.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
MouseDown.x:=x;
MouseDown.y:=y;
Capture:=true;
end;
{--------------------------------Move the picture----------------------------------------}
procedure TForm_3011.Image1MouseMove(Sender: TObject; Shift: TShiftState;
X, Y: Integer);
begin
if Capture then
begin
so.HorzScrollBar.Position := so.HorzScrollBar.Position+trunc((X-MouseDown.x)/20);
so.VertScrollBar.Position := so.VertScrollBar.Position+trunc((Y-MouseDown.y)/20);
end;
end;
{-------------------------------Move the picture-----------------------------------------}
procedure TForm_3011.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Capture then
begin
Capture:=false;
so.HorzScrollBar.Position := so.HorzScrollBar.Position+trunc((X-MouseDown.x)/20);
so.VertScrollBar.Position := so.VertScrollBar.Position+trunc((Y-MouseDown.y)/20);
end;
end;
procedure TForm_3011.BitBtn1Click(Sender: TObject);//缩小图象
begin
Image1.AutoSize:=false;
Image1.Stretch:=true;
Image1.Height:=trunc(Image1.Height*2/3);
Image1.Width:=trunc(Image1.Width*2/3);
end;
procedure TForm_3011.BitBtn2Click(Sender: TObject);//放大图象
begin
Image1.AutoSize:=false;
Image1.Stretch:=true;
Image1.Height:=trunc(Image1.Height*3/2);
Image1.Width:=trunc(Image1.Width*3/2);
end;