Thanks, that worked like a charm, another question i have had, is, when I
view the bitmap on my screen canvas, using a TImage, the bitmaps don't
usually look very good, why is this. The colours dont look right, but when I
print its fine.

Jason

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Max Nilson
Sent: Thursday, 1 June 2000 11:06 a.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: JPEG to Bitmap


Jason Coley asked:

> So is there a way to convert the JPEG to a BMP in Delphi,
> I'm using D3.

The code I used (in Delphi 5) is:

  Bitmap := TBitmap.Create;
  Bitmap.PixelFormat := pf24Bit;
  Bitmap.HandleType := bmDIB;
  Bitmap.Width := Picture.Width;
  Bitmap.Height := Picture.Height;
  Bitmap.Canvas.Draw(0, 0, Picture.Graphic);

where Picture is a TPicture that contains a JPEG via the standard Delphi
JPEG code that has been supplied as an optional add on for yonks now. I
fairly certain that the above method should be portable to most Delphi
versions, and can be used to convert any supported TPicture graphic type
into a bit map.

Cheers, Max.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to