O'Reilly logo

Embedded Programming with the Microsoft® .NET Micro Framework by Rob Miles, Donald Thompson

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

Drawing Text

The Bitmap class also provides methods to allow you to write text on the display. The character designs are expressed as font rasters, which cannot be scaled; instead, you must provide versions for each size that you require. The font raster that you wish to use can be stored as a data resource that you need to add to the project. The Font instance itself is created from a font resource:

Font myFont = Resources.GetFont(Resources.FontResources.NinaB)

This font can now be supplied to the methods that draw text in a bitmap.

Drawing Text in a Bitmap

The Bitmap class provides the DrawText method, which can be used to place text on the display at a particular position.

Font myFont = Resources.GetFont(Resources.FontResources.NinaB); myBitmap.DrawText( ...

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