Bitmap

  1. JPEG and bitmaps in Delphi 3

JPEG and bitmaps in Delphi 3

From: David Irizarry <xerxees@ix.netcom.com>

> >Using Delphi 3, how do I translate a bitmap into an JPEG file? > Assume Image1 is a TImage component containing a bitmap. You could use the following code segment to convert the bitmap into a JPEG file format:


var
  MyJpeg: TJpegImage;
  Image1: TImage;
begin
  Image1:= TImage.Create;
  MyJpeg:= TJpegImage.Create;
  Image1.LoadFromFile('TestImage.BMP');  // Load the Bitmap from a file
  MyJpeg.Assign(Image1.Picture.Bitmap);  // Assign the BitMap to MyJpeg
object
  MyJpeg.SaveToFile('MyJPEGImage.JPG'); // Save the JPEG to Disk
end;


Please email me and tell me if you liked this page.