UserPalette property (Main Control)

Visual Basic example
Visual C++ 4.0 example

Access 2.0 example

Access 95, 97 example
Visual J++ example

Syntax OLE_COLOR UserPalette (short iIndex);

Overview:  Refer to Managing Palettes.

Remarks

Sets a color in a palette that you define.

The user palette is an array of 256 elements. Each element is a long integer value containing the red, green and blue (RGB) components of the color. You can specify a color using the RGB function, and you can specify 256 or fewer colors.

To apply a palette to a bitmap, you must first use this property to set each of the colors in the array; then use the ColorRes method to implement the palette.

This property is also used when loading raw, uncompressed data that is 8 bits per pixel or less. To do this, assign a palette in the UserPalette property in the LoadInfo event. For more information, refer to Working with the RAW File Filter.

Palettes are used only for images that are 8 bits per pixel or less.

See Also

Topics:  Raster Images: Palettes
Raster Images: Doing Color Expansion or Reduction