Delphi image 等比例缩小

2022-11-23 10:54:36 作者:admin

本文整理自网络,侵删。

 //等比例缩小uses Math;varZoom:Extended;W,H:integer;bmp:Tbitmap;begin  bmp:=Tbitmap.Create;  bmp.LoadFromFile('c:\aa.bmp');  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);  bmp.free;end; 

相关阅读 >>

Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改

Delphi usbkey访问、Delphi、js

Delphi 网卡工作状态检测

Delphi 获取ie网址收藏夹

Delphi getmimetype 查询文件mime类型函数

5种运行程序的方法具体应用实例

Delphi richedit文字背景色的处理

Delphi 2010 复制整个文件夹(当然包括嵌套文件夹)

Delphi 中showmodal与show的区别

Delphi firedac 下的 sqlite [11] - 关于批量提交 sql 命令的测试

更多相关阅读请进入《Delphi》频道 >>



在线咨询 拨打电话