4.6. A Real-World Example: Adding Colors, Pens, and Brushes to the GDI+Painter Application

In Chapter 3 we created the GDI+Painter application, which allows us to draw simple objects, such as a line, a rectangle, and an ellipse. In this section we will extend the functionality of GDI+Painter by adding support for brushes and pens. After completing this section, you will be able to select a pen color and its width, color transparency, and brush color.

Figure 4.32 shows the modified version of GDI+Painter without any objects..

Figure 4.32. GDI+Painter with pen and brush support

Transparency is a component of the color in GDI+. In the .NET Framework ...

Get Graphics Programming with GDI+ 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.