Working with Brushes and Pens

Brushes and Pens are the two most frequently used objects in graphics applications. Pens are used to draw the outlines of graphics objects such as lines and curves; brushes are used to fill the graphic objects' interior areas (e.g., filling a rectangle or an ellipse). In this chapter we will discuss how to create and use various types of brushes and pens.

We begin by discussing brushes, brush types, their methods and properties, and how to create and use them in GDI+.

GDI+ provides the Pen and Pens classes to represent pens. In this chapter we will discuss how to create different kinds of pens using the Pen class and its properties, and how to use the Pen class methods. We will also discuss how to add line caps, dash caps, line dash styles, and line cap styles. In Sections 4.3 and 4.4 we will discuss the transformation of pens and brushes.

The SystemPens and SystemBrushes classes represent the system pens and brushes, respectively. In Section 4.5 we will discuss how to use these classes to work with system pens and brushes.

At the end of this chapter we will add color, pen, and brush options to the GDI+Painter application that we created in Chapter 3.

Категории