Convert BMP to JPG

With this procedure below you can convert BMP to JPG.

uses jpeg;

procedure ConvertBMPtoJPG;
var
bmp : TImage;
jpg : TJpegImage;
begin
bmp := TImage.Create(nil);
jpg := TJpegImage.Create;
bmp.picture.bitmap.LoadFromFile ( ‘c:\picture.bmp’ );
jpg.Assign( bmp.picture.bitmap );
// Here you can set the jpg object’s properties as compression, size and more
jpg.SaveToFile ( ‘c:\picture.jpg’ );
jpg.Free;
bmp.Free;
end;

This entry was posted in Graphics. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string NkzwhG to the field below: