Skip to Content
.NET Windows Forms in a Nutshell
book

.NET Windows Forms in a Nutshell

by Ian Griffiths, Matthew Adams
March 2003
Intermediate to advanced
896 pages
32h 35m
English
O'Reilly Media, Inc.
Content preview from .NET Windows Forms in a Nutshell

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()

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Windows Forms 2.0 Programming

Windows Forms 2.0 Programming

Chris Sells, Michael Weinhardt
Pro C# 7: With .NET and .NET Core

Pro C# 7: With .NET and .NET Core

Andrew Troelsen, Philip Japikse

Publisher Resources

ISBN: 0596003382Supplemental ContentCatalog PageErrata