[This is preliminary documentation and subject to change.]
Starting with Windows 98 and Windows NT 5.0, the StretchDIBits and SetDIBitsToDevice functions have been extended to allow JPEG images to be passed as the source image. The extensions allow SetDIBitsToDevice and StretchDIBits to send JPEG images to printer devices. This extension is not intended as a means to supply general JPEG decompression to applications, but rather to allow applications to send JPEG compressed images directly to printers having hardware support for JPEG images.
The BITMAPINFOHEADER, BITMAPV4HEADER and BITMAPV5HEADER structures are extended to allow specification of a new compression value indicating that the bitmap data is a JPEG image. This new compression value is only valid for SetDIBitsToDevice and StretchDIBits when the hdc parameter specifies a printer device. To support metafile spooling of the printer, the application should not rely on the return value to determine whether the device supports the JPEG file. The application must issue the QUERYESCSUPPORT escape before calling SetDIBitsToDevice and StretchDIBits. If the validation escape fails, the application must then fall back on its own JPEG support to decompress the image into a bitmap.