Colors

So far, I've been drawing the ellipse in my form using a built-in dark blue brush. A brush, as you'll see, is for filling the interior of a shape, whereas a pen is used to draw the edge of a shape. Either way, suppose I'm not quite happy with the dark blue brush. Instead, I'd like a brush of one of the more than 16 million colors that doesn't come prebuilt for me, and this means that I first need to specify the color in which I'm interested. Color is modeled in .NET via the Color structure:

 struct Color { // No color public static readonly Color Empty; // Built-in colors public static Color AliceBlue { get; } // ... public static Color YellowGreen { get; } // Properties public byte A { get; } public byte B { get; } public byte G { get; ...

Get Windows Forms Programming in C# 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.