begin
image1.Align := alNone ;
image1.AutoSize := false;
image1.Left := trunc(image1.Left-image1.Width/1.2);
image1.Top := trunc(image1.Top-image1.Height/1.2);
image1.Height :=trunc(image1.Height *1.2) ;
image1.Width := trunc(image1.Width * 1.2);
image1.Center := True ;
end;
我想让图像在原来的位置上放大。不知为什么这样写就是不对
image1.Align := alNone ;
image1.AutoSize := false;
image1.Left := trunc(image1.Left-image1.Width/1.2);
image1.Top := trunc(image1.Top-image1.Height/1.2);
image1.Height :=trunc(image1.Height *1.2) ;
image1.Width := trunc(image1.Width * 1.2);
image1.Center := True ;
end;
我想让图像在原来的位置上放大。不知为什么这样写就是不对
图像放大需要重新进行拷贝先创建一个TImage用来保存原图,比如叫做ScrImage
放大和缩小Image1的时候,都要以ScrImage为标准进行放大和缩小时
先改变Image1的位置和大小
然后Image1.Canvas.CopyRect(.., ScrImage.Canvas, ..);
就行了
image1.AutoSize := false;下面加一句Image.Stretch:=True;
AutoSize是图象随着控件的大小改变而改变,
Stretch是控件的大小随着图象的大小改变而改变。