How To…Export Gray Scale Jpegs

Question

“Is is possible to export jpegs that are gray scaled?”

Solution

Use the Report.OnFileDeviceCreated event to configure the JPGDevice.Jpeg property. This Jpeg property is of type TJpeg, a Delphi VCL class.

All of the image devices share this common architecture. The BmpDevice has a Bitmap property, the MetaFileDevice has a Metafile property, etc.

Download:  JpgDeviceGrayScale.zip

Sample Delphi Code: