TWAIN and Raw RGB Format

When an application transfers an image whose format GUID is WiaImgFmt_RAWRGB (defined in header file wiadef.h), the following properties on the image must contain the correct values for the image:

  • WIA_IPA_CHANNELS_PER_PIXEL

  • WIA_IPA_BITS_PER_CHANNEL

  • WIA_IPA_PIXELS_PER_LINE

  • WIA_IPA_NUMBER_OF_LINES

  • WIA_IPS_XRES

  • WIA_IPS_YRES

Furthermore, the WIA_IPA_DATATYPE property should be set to WIA_DATA_COLOR and the WIA_IPA_DEPTH property should be set to 24 or higher. For more information about these properties, see the Microsoft Windows SDK documentation.

Any data in the raw RGB format to be transferred must be:

  • Uncompressed

  • Arranged in RGB byte order

  • Aligned on DWORD boundaries

The data must be transferred with no image header. The IWiaDataCallback::BandedDataCallback method (described in the Windows SDK documentation) sends only the image bits.

The TWAIN compatibility layer (see Support for TWAIN-Compatible Applications) supports the WiaImgFmt_RAWRGB format GUID. This enables TWAIN applications to transfer images with pixel depths greater than 32 bits, using a memory-callback transfer.