This chapter examined using GDI+ to draw graphics in your Windows Forms applications. The Point, Size, and Rectangle structures are used throughout the GDI+ and Windows Forms classes to specify the shapes, locations, and sizes of graphical objects.
The key class used with GDI+ is the Graphics class, which exposes methods and properties for performing graphics operations, as well as for gathering information about the display. The Graphics class uses other classes to draw to the display. The Brush class and its descendant classes are used to fill areas, such as rectangles or ellipses. Brush objects can be created in a wide range of colors, or they can be created with various hatching styles, images, or graphics paths. The Pen class is used to draw lines and shapes such as rectangles. Pen objects can be created in a variety of styles and colors—they can even be created from an existing Brush object. The Graphics class uses the Font class to draw text.
In Chapter 15, we’ll look at more Windows Forms controls and we’ll also examine techniques for anchoring and docking controls.