This project has moved. For the latest updates, please go here.

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:
  • ColorPalette Get() - This operation causes the DS to report its current palette information
  • ColorPalette GetDefault() - This operation causes the DS to report its power-on default palette
  • void Reset(ColorPalette palette) - This operation causes the DS to dispose of any current palette it has and to use its default palette for the next palette transfer
  • void Set(ColorPalette palette) - This operation requests that the DS adopt the specified palette for use with all subsequent palette transfers
Example usage is shown below:

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

Last edited May 2, 2014 at 10:41 AM by SARAFF, version 4