Name

ColorPalette

Synopsis

This class encapsulates an array of related colors that make up a color palette.

You can retrieve an array of the Entries in the palette (each is a System.Drawing.Color value).

You can also get a Flags integer that rather unpleasantly depends on the magic cookies 0x01 to indicate that the colors contain alpha information, 0x02 to indicate that the colors represent grayscales, and 0x04 to indicate that the array contains halftone values. Those values are listed in the PaletteFlags enumeration, but you have to cast them to an integer before they can be used.


public sealed class ColorPalette {

// Public Instance Properties

   public Color[ ] Entries{get; }

   public int Flags{get; }

}

Returned By

System.Drawing.Image.Palette

Passed To

System.Drawing.Image.Palette, ImageAttributes.GetAdjustedPalette()

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.