View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.NET / Contents

Color Information for an Image

This operations assume that the application has instructed the DS to use the TwPixelType.Palette type for its PixelType capability and that the DS has accepted this. The Palette operations allow the application to inquire about a Source’s support for palette color data and to set up a palette color transfer. The operations are specialized for 8-bit data, whether grayscale or color (8-bit or 24-bit). To operate with a palette provides the following methods:

Example usage is shown below:

this._palette=this._twain32.Palette.Get();
Color _color=this._palette.Colors[e.ImageMemXfer.ImageData[_rowOffset+_colOffset]];
this._stream.Write(new byte[] { _color.R,_color.G,_color.B },0,3);