不知道楼主用的什么方式实现的缩放,试试下面的代码:
{参数1:源图象image
参数2:放大后图象image
参数3:放大倍数
不区分图象格式,只要能在image中显示就行
对透明、半透明部分无法处理}
procedure TForm1.ImageZoom(source,target:timage;scale:single=1.5);
var
rect:trect;
sbmp,tbmp:tbitmap;
begin
if assigned(source.Picture.Graphic) then begin
tbmp:=tbitmap.Create;
sbmp:=tbitmap.Create;
try
sbmp.Assign(source.Picture.Graphic);
tbmp.Width:=round(sbmp.Width*scale);
tbmp.Height:=round(sbmp.Height*scale);
tbmp.Canvas.CopyRect(tbmp.Canvas.ClipRect,sbmp.Canvas,
sbmp.Canvas.ClipRect);
target.SetBounds(target.Left,target.Top,tbmp.Width,tbmp.Height);
target.Picture.Assign(tbmp);
finally
sbmp.Free;
tbmp.Free;
end;
end;
end;