Zoom:=Image1.Width/Max(bmp.Width,bmp.Height); //获得比例值
W:=Trunc(bmp.Width*Zoom);
H:=Trunc(bmp.Height*Zoom);
//居中显示缩小后的图片
Image1.Canvas.StretchDraw(Rect(Trunc((Image1.width-W)/2),Trunc((Image1.Height-H)/2),Trunc((Image1.width-W)/2)+W,Trunc((Image1.Height-H)/2)+H),Bmp);
W:=Trunc(bmp.Width*Zoom);
H:=Trunc(bmp.Height*Zoom);
//居中显示缩小后的图片
Image1.Canvas.StretchDraw(Rect(Trunc((Image1.width-W)/2),Trunc((Image1.Height-H)/2),Trunc((Image1.width-W)/2)+W,Trunc((Image1.Height-H)/2)+H),Bmp);