delphi jpeg图片压缩


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;


联系电话:
020-00000000
联系电话:
020-00000000
联系电话:
020-12345678