发信人: asynce()
整理人: soaringbird(2002-01-16 09:59:43), 站内信件
|
功能是看见全图但不变形
image1的strech是true
procedure LoadPic(S:string);
var x,y:integer;
xscale,yscale:real;
begin
Image1.Picture:=nil;
if fileexists(S) then
Image1.Picture.LoadFromFile(S);
x:=image1.Picture.Width;
y:=image1.Picture.Height;
xscale:=x/321; //321为image1的设计显示宽度
yscale:=y/225; //225为image1的设计显示高度
if xscale>yscale then begin
image1.Width:=321;
image1.Height:=trunc(y/xscale);
end
else begin
image1.Width:=trunc(x/yscale);
image1.Height:=225;
end;
end; |
|