delphi 将image组件的图片保存为JPG格式图片方法


本文整理自网络,侵删。

 procedure SaveAsJPG ;

var

jp: TJPEGImage; //Requires the "jpeg" unit added to "uses" clause.

begin

jp := TJPEGImage.Create;

try

with jp do

begin

jp.CompressionQuality := 2;

jp.Compress ;

Assign(Image1.Picture.Bitmap);

SaveToFile(''''D:\zhy.jpg'''');

end;

finally

jp.Free;

end;

////---读入方法如下:

procedure OpenJPGInImage

var

jp: TJPEGImage; //Requires the "jpeg" unit added to "uses" clause.

begin

jp := TJPEGImage.Create;

jp.LoadFromFile(''''D:\zhy.jpg'''');

try

with jp do

begin

image1.Picture.Bitmap.Assign(jp);

end;

finally

jp.Free;

end;

end;

相关阅读 >>

Delphi释放内存一般这么写

Delphi pos的用法

Delphi操作文本文件简介

Delphi 中打开浏览器跳转网址链接网页的几种方法

Delphi 字符串变形替换

indy tidtcpclient 的一个用法上要留意的问题,以及 http

Delphi 遍历注册表

Delphi 系统托盘 trayicon

Delphi中txmldocument控件的用法

Delphi

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



打赏

取消

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

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

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

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

评论

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