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 combobox 只读 text属性可用的方法

Delphi 文件占坑法过360查杀

Delphi 能否把.txt文件的数据导入到access数据库中

Delphi中内嵌汇编

Delphi xe mysql数据库操作类 mysqlhelper

Delphi listview 实现进度条显示

Delphi程序只允许运行一个实例的三种方法

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

Delphi格式化wmi中的datetime

Delphi webbrowser控件属性

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



打赏

取消

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

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

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

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

评论

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