主题:请看一下这段代码
请教:
procedure Tpic_Form.ZoomPicture(Zoom:single);
var
DRect:TRect;
w,h :integer;
bitmap:TBitMap;
begin
w:=Round(Image1.Width*Zoom);
h:=Round(Image1.Height*Zoom);
DRect:=Rect(0,0,w,h);
Bitmap:=TBitmap.Create;
try
bitmap.Width:=w;
bitmap.Height:=h;
bitmap.Canvas.StretchDraw(DRect,Image1.Picture.Graphic);
Image2.Parent:=ScrollBox1;
image2.Width:=w;
image2.Height:=h;
image2.BringToFront;
image2.Visible:=true;
image1.Visible:=false;
Image2.Picture.Assign(bitmap);
finally
BitMap.Free;
end;
end;
请帮我看看这段代码的功能!谢谢!!
procedure Tpic_Form.ZoomPicture(Zoom:single);
var
DRect:TRect;
w,h :integer;
bitmap:TBitMap;
begin
w:=Round(Image1.Width*Zoom);
h:=Round(Image1.Height*Zoom);
DRect:=Rect(0,0,w,h);
Bitmap:=TBitmap.Create;
try
bitmap.Width:=w;
bitmap.Height:=h;
bitmap.Canvas.StretchDraw(DRect,Image1.Picture.Graphic);
Image2.Parent:=ScrollBox1;
image2.Width:=w;
image2.Height:=h;
image2.BringToFront;
image2.Visible:=true;
image1.Visible:=false;
Image2.Picture.Assign(bitmap);
finally
BitMap.Free;
end;
end;
请帮我看看这段代码的功能!谢谢!!