BitmapPalettes Class

BitmapPalettes Class

 

Defines several color palettes that are commonly used by bitmap images.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

System.Object
  System.Windows.Media.Imaging.BitmapPalettes

public static class BitmapPalettes

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticBlackAndWhite

Gets a value that represents a black-and-white color palette. This palette consists of 2 colors total.

System_CAPS_pubpropertySystem_CAPS_staticBlackAndWhiteTransparent

Gets a value that represents a black, white, and transparent color palette. This palette consists of 3 colors total.

System_CAPS_pubpropertySystem_CAPS_staticGray16

Gets a value that represents a color palette that contains 16 shades of gray. The palette ranges from black to gray to white. This palette contains 16 total colors.

System_CAPS_pubpropertySystem_CAPS_staticGray16Transparent

Gets a value that represents a color palette that contains 16 shades of gray. The palette ranges from black to gray to white with an additional transparent color. This palette contains 17 total colors.

System_CAPS_pubpropertySystem_CAPS_staticGray256

Gets a value that represents a color palette that contains 256 shades of gray, ranging from black to gray to white. This palette contains 256 total colors.

System_CAPS_pubpropertySystem_CAPS_staticGray256Transparent

Gets a value that represents a color palette that contains 256 shades of gray, ranging from black to gray to white with an additional transparent color. This palette contains 257 total colors.

System_CAPS_pubpropertySystem_CAPS_staticGray4

Gets a value that represents a color palette that contains 4 shades of gray, ranging from black to gray to white. This palette contains 4 total colors.

System_CAPS_pubpropertySystem_CAPS_staticGray4Transparent

Gets a value that represents a color palette that contains 4 shades of gray, ranging from black to gray to white with an additional transparent color. This palette contains 5 total colors.

System_CAPS_pubpropertySystem_CAPS_staticHalftone125

Gets a value that represents a color palette that contains 125 primary colors and 16 system colors, with duplicate colors removed. There are a total of 133 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone125Transparent

Gets a value that represents a color palette that contains 125 primary colors, 16 system colors, and 1 additional transparent color. Duplicate colors in the palette are removed. There are a total of 134 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone216

Gets a value that represents a color palette that contains 216 primary colors and 16 system colors, with duplicate colors removed. There are a total of 224 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone216Transparent

Gets a value that represents a color palette that contains 216 primary colors, 16 system colors, and 1 additional transparent color. Duplicate colors in the palette are removed. There are a total of 225 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone252

Gets a value that represents a color palette that contains 252 primary colors and 16 system colors, with duplicate colors removed. There are a total of 256 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone252Transparent

Gets a value that represents a color palette that contains 252 primary colors, 16 system colors, and 1 additional transparent color. Duplicate colors in the palette are removed. There are a total of 256 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone256

Gets a value that represents a color palette that contains 256 primary colors and 16 system colors, with duplicate colors removed. There are a total of 256 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone256Transparent

Gets a value that represents a color palette that contains 256 primary colors, 16 system colors, and 1 additional transparent color that replaces the final color in the sequence. Duplicate colors in the palette are removed. There are a total of 256 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone27

Gets a value that represents a color palette that contains 27 primary colors and 16 system colors, with duplicate colors removed. There are a total of 35 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone27Transparent

Gets a value that represents a color palette that contains 27 primary colors and 16 system colors, with duplicate colors removed and 1 additional transparent color. There are a total of 36 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone64

Gets a value that represents a color palette that contains 64 primary colors and 16 system colors, with duplicate colors removed. There are a total of 72 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone64Transparent

Gets a value that represents a color palette that contains 64 primary colors and 16 system colors, with duplicate colors removed and 1 additional transparent color. There are a total of 73 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone8

Gets a value that represents a color palette that contains 8 primary colors and 16 system colors, with duplicate colors removed. There are a total of 16 colors in this palette, which are the same as the system palette.

System_CAPS_pubpropertySystem_CAPS_staticHalftone8Transparent

Gets a value that represents a color palette that contains 8 primary colors and 16 system colors, with duplicate colors removed and 1 additional transparent color. There are a total of 17 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticWebPalette

Gets a value that represents a color palette that contains 216 primary colors and 16 system colors, with duplicate colors removed. There are a total of 224 colors in this palette.

System_CAPS_pubpropertySystem_CAPS_staticWebPaletteTransparent

Gets a value that represents a color palette that contains 216 primary colors and 16 system colors, with duplicate colors removed and 1 additional transparent color. There are a total of 225 colors in this palette.

BitmapPalettes properties whose names end with "Transparent" have an additional "color" that is fully transparent. In the case of palettes that already have 256 colors, the last color is replaced by the transparent color.

Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) image formats support palettes.

The following code example demonstrates how to construct a new BitmapSource by using a member of the BitmapPalettes class in a similar way.

BitmapSource image5 = BitmapSource.Create(
    width,
    height,
    96,
    96,
    PixelFormats.Indexed1,
    BitmapPalettes.WebPalette,
    pixels,
    stride);

FileStream stream5 = new FileStream("palette.tif", FileMode.Create);
TiffBitmapEncoder encoder5 = new TiffBitmapEncoder();
encoder5.Frames.Add(BitmapFrame.Create(image5));
encoder5.Save(stream5);

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft