image怎样按比例显示一幅图片 一图片很大时,image正常不能全部显示,怎样按比例宿少图片再显示呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 var hh,ww,xx:real;begin hh:=236; //image的高度 ww:=188; //image的宽度 if (hh < image1.Picture.Height) or (ww < image1.Picture.Width) then begin image1.Stretch :=true; if (hh / image1.Picture.Height) < (ww / image1.Picture.Width) then xx:= image1.Picture.Height / hh else xx:=image1.Picture.Width / ww; image1.Height :=image1.Picture.Height / xx; image1.width :=image1.Picture.width / xx; end else begin image1.Height :=hh; image1.Width :=ww; image1.Stretch :=false; end;end; 这段函数应该能满足你的要求 image1.Height :=image1.Picture.Height / xx;这里出错了 nihongjiang(jacky-ni) 的代码启示:如果那样行的话为什么不改成这样呢?:begin image1.Stretch :=true; image1.Picture.Width:=image1.width; image1.Picture.Height:=image1.heigth;end; 这段函数应该能满足你的要求 上面的函数应该可以实现这个功能我简单的解释一下函数思想吧 完了你可以自己改或写IF 图片高>image高 or 图片宽>image宽begin 图片高=image高 图片宽=图片宽 X (image高/图片高)end; 用delphi做一个数据库增量备份`急急急急啊 DBNavigator1的"+"號代表AdoDataSet的哪個事件? 关于语法格式的问题 如何在代码中指定要连接的数据库? 關於在建立三層時出現的錯誤 TreeView点击不同菜单项目,右边的弹出窗口内涵于一个固定大小的控件中,例如Panel d6中怎样调用winexec或Shellexec实现根据url地址打开网页或打开outlook发送邮件 紧急情况! TADOQuery是否可以支持主从查询 救救我,update怎么写,100分相送。 租房被骗,郁闷..... 散分 有关DBGRID行的显示颜色问题
hh,ww,xx:real;
begin
hh:=236; //image的高度
ww:=188; //image的宽度
if (hh < image1.Picture.Height) or (ww < image1.Picture.Width) then
begin
image1.Stretch :=true;
if (hh / image1.Picture.Height) < (ww / image1.Picture.Width) then
xx:= image1.Picture.Height / hh
else
xx:=image1.Picture.Width / ww; image1.Height :=image1.Picture.Height / xx;
image1.width :=image1.Picture.width / xx;
end
else
begin
image1.Height :=hh;
image1.Width :=ww;
image1.Stretch :=false;
end;
end; 这段函数应该能满足你的要求
如果那样行的话为什么不改成这样呢?:
begin
image1.Stretch :=true;
image1.Picture.Width:=image1.width;
image1.Picture.Height:=image1.heigth;end; 这段函数应该能满足你的要求
begin
图片高=image高 图片宽=图片宽 X (image高/图片高)
end;