1.1. Using Graphics, Pens, and Brushes

Whenever you draw in C#, you draw on a Graphics object. You can think of this object as representing the canvas or piece of paper on which you will draw. There are several occasions when you may want to draw (when a form refreshes, to update an image, when generating a printout), but they all use the same kind of Graphics object. That's great news because it means you only need to learn how to draw in one way and you can use the same code to draw on just about anything.

The Pen class determines the characteristics of line-like graphics. This includes straight lines as well as the edges of ellipses, rectangles, arcs, Bezier curves, and other drawn lines. The Pen object determines the line's color, thickness, ...

Get C# Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.