O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Classes Used to Draw Shapes, Bitmaps, and Text

There are a number of other classes that the methods of the Graphics object use to draw shapes, bitmaps, and text to its drawing surface, and I will take some time here to briefly describe them before discussing the Graphics class itself.

The Pen Class

The Pen class is used to draw outline shapes and lines. Unlike the full .NET Framework, the .NET Compact Framework allows you to create a Pen object only by specifying the color you want the Pen to draw—you can’t create a Pen object from a Brush object or specify the size of the Pen. However, you can change the color of the Pen after you have created it by using the Color property of the Pen object. The following sample code shows how to create the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required