delphi JPG/JPEG 图片缩放函数


本文整理自网络,侵删。

 
function ChangeJpegSize(FileName,FileName2: string; W, H: Integer): Boolean;
var
jpg: TJPEGImage;
bmp: TBitmap;
begin
Result := False;
jpg := TJPEGImage.Create;
try
    jpg.LoadFromFile(FileName);
    bmp := TBitmap.Create;
    bmp.Width := W;
    bmp.Height := H;
    bmp.Canvas.StretchDraw(Rect(0, 0, bmp.Width, bmp.Height), jpg);
    jpg.Assign(bmp);
    try
      jpg.SaveToFile(FileName2);
      Result := True;
    finally
      bmp.Free;
    end;
finally
    jpg.Free;
end;
end;

相关阅读 >>

Delphi整理三(窗体和基本组件)

Delphi xe10 文件目录/路径操作 (andorid、ios、windows)

Delphi操作usb摄像头类

Delphi 清除windows 图标缓存源代码

qdac项目

Delphi 以十六进制显示数据内容

Delphi 调用wmi信息判断系统师傅安装杀毒软件

如何用Delphi实现子目录级的文件查询

Delphi中tlistview控件使用

Delphi获取闲置时间

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



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...