Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PaletteType enumeration

Applies to: desktop apps only

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  {
  PaletteTypeCustom             = 0,
  PaletteTypeOptimal            = 1,
  PaletteTypeFixedBW            = 2,
  PaletteTypeFixedHalftone8     = 3,
  PaletteTypeFixedHalftone27    = 4,
  PaletteTypeFixedHalftone64    = 5,
  PaletteTypeFixedHalftone125   = 6,
  PaletteTypeFixedHalftone216   = 7,
  PaletteTypeFixedHalftone252   = 8,
  PaletteTypeFixedHalftone256   = 9 
} PaletteType;

Constants

PaletteTypeCustom

An arbitrary custom palette provided by the caller.

PaletteTypeOptimal

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

A palette that has two colors. This palette type is suitable for bitmaps that store 1 bit per pixel.

PaletteTypeFixedHalftone8

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

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

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

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

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

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

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Product

GDI+ 1.1

Header

GdiplusPixelFormats.h (include Gdiplus.h)

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show:
© 2014 Microsoft