本文整理自网络,侵删。
uses jpeg;
procedure ZipJPEG;
var
jpg: TJpegImage;
bmp: TBitmap;
begin
jpg := TJpegImage.Create;
bmp := TBitmap.Create;
try
jpg.LoadFromFile('c:\A.jpg');
bmp.Width := jpg.Width;
bmp.Height := jpg.Height;
bmp.Canvas.StretchDraw(bmp.Canvas.ClipRect, jpg);
jpg.Assign(bmp);
jpg.CompressionQuality := 10;
jpg.Compress;
jpg.SaveToFile('C:\AA.jpg');
finally
bmp.free;
jpg.free;
end;
end;
相关阅读 >>
Delphi 通过memorystream 传递image1数据
Delphi idhashmessagedigest 获取文件md5
Delphi xe6 string转memorystream
更多相关阅读请进入《Delphi》频道 >>