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

Displaying Images

The Image component allows the display of images. It has a single property, the image we want to draw, which the component holds as a bitmap.

Bitmap b = Resources.GetBitmap(Resources.BitmapResources.Background);
Image i = new Image(b);

This code creates a bitmap and then constructs an image based on it. We can then add the image to a StackPanel or Canvas and use it as part of a display.

Creating a Custom Image—A Meter with a Dial

We can perform further customization of the components, and learn more about how to do this, by creating an image with an additional component on top. The aim of the class MeterDialPanel is to draw an indicator needle on a background graphic to allow a device to display a dial.

Figure 7-17 shows how we can ...

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