O'Reilly logo

Microsoft® Mobile Development Handbook by Peter Foot, Daniel Moth, 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

Rotating Text

One addition to Microsoft .NET Compact Framework version 2.0 that is useful for working with text is support for the LogFont class, which defines the characteristics of a font for creating rotated text effects. This class is in the Microsoft.WindowsCE.Forms namespace, so you must add a reference to that assembly to use it.

The LogFont class is easy to use. Simply create a LogFont object, set properties to define the size and angle of the font, and then call the Font.FromLogFont method to return the System.Drawing.Font instance you use for drawing text. The following code shows a method you can use to do this:

using System.Drawing; using Microsoft.WindowsCE.Forms; ... private const float POINTS_PER_INCH = 72f; private Font CreateLogFont(int ...

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