GDI+压缩图片 image/png image/jpeg

var

  encoderClsid: TGUID;

  stat: TStatus;

  image: TGPImage;

begin

  image := TGPImage.Create('a.bmp');

  GetEncoderClsid('image/jpeg', encoderClsid);

  stat := image.save('a.jpg', encoderClsid, nil);

  if ( stat= OK ) then

    memo1.lines.add('Save Successfully!')

  else 

    memo1.lines.add( format( 'Failure: stat = %s',[GetStatus(stat)]));

  image.free;

end;

 

你可能感兴趣的:(image)