PaletteType enumeration (gdipluspixelformats.h)

The PaletteType enumeration is used by the Bitmap::InitializePalette and Bitmap::ConvertFormat methods of the Bitmap class. The members of the enumeration identify several standard color palette formats.

Syntax

typedef enum PaletteType {
  PaletteTypeCustom = 0,
  PaletteTypeOptimal = 1,
  PaletteTypeFixedBW = 2,
  PaletteTypeFixedHalftone8 = 3,
  PaletteTypeFixedHalftone27 = 4,
  PaletteTypeFixedHalftone64 = 5,
  PaletteTypeFixedHalftone125 = 6,
  PaletteTypeFixedHalftone216 = 7,
  PaletteTypeFixedHalftone252 = 8,
  PaletteTypeFixedHalftone256 = 9
} ;

Constants

 
PaletteTypeCustom
Value: 0
An arbitrary custom palette provided by the caller.
PaletteTypeOptimal
Value: 1
An palette of colors that are optimal for a particular bitmap. To create an optimal palette, pass PaletteTypeOptimal, the number of colors you want in the palette, and the address of a Bitmap object to the Bitmap::InitializePalette method.
PaletteTypeFixedBW
Value: 2
A palette that has two colors. This palette type is suitable for bitmaps that store 1 bit per pixel.
PaletteTypeFixedHalftone8
Value: 3
A palette based on two intensities each (off or full) for the red, green, and blue channels. Also contains the 16 colors of the system palette. Because all eight of the on/off combinations of red, green, and blue are already in the system palette, this palette is the same as the system palette. This palette type is suitable for bitmaps that store 4 bits per pixel.
PaletteTypeFixedHalftone27
Value: 4
A palette based on three intensities each for the red, green, and blue channels. Also contains the 16 colors of the system palette. Eight of the 16 system palette colors are among the 27 three-intensity combinations of red, green, and blue, so the total number of colors in the palette is 35. If the palette also includes the transparent color, the total number of colors is 36.
PaletteTypeFixedHalftone64
Value: 5
A palette based on four intensities each for the red, green, and blue channels. Also contains the 16 colors of the system palette. Eight of the 16 system palette colors are among the 64 four-intensity combinations of red, green, and blue, so the total number of colors in the palette is 72. If the palette also includes the transparent color, the total number of colors is 73.
PaletteTypeFixedHalftone125
Value: 6
A palette based on five intensities each for the red, green, and blue channels. Also contains the 16 colors of the system palette. Eight of the 16 system palette colors are among the 125 five-intensity combinations of red, green, and blue, so the total number of colors in the palette is 133. If the palette also includes the transparent color, the total number of colors is 134.
PaletteTypeFixedHalftone216
Value: 7
A palette based on six intensities each for the red, green, and blue channels. Also contains the 16 colors of the system palette. Eight of the 16 system palette colors are among the 216 six-intensity combinations of red, green, and blue, so the total number of colors in the palette is 224. If the palette also includes the transparent color, the total number of colors is 225. This palette is sometimes called the Windows halftone palette or the Web palette.
PaletteTypeFixedHalftone252
Value: 8
A palette based on 6 intensities of red, 7 intensities of green, and 6 intensities of blue. The system palette is not included. The total number of colors is 252. If the palette also includes the transparent color, the total number of colors is 253.
PaletteTypeFixedHalftone256
Value: 9
A palette based on 8 intensities of red, 8 intensities of green, and 4 intensities of blue. The system palette is not included. The total number of colors is 256. If the transparent color is included in this palette, it must replace one of the RGB combinations.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Header gdipluspixelformats.h (include Gdiplus.h)