Chapter 21. Working with bitmap images
This chapter covers
- Working with images
- Creating images on the fly
- Deep Zoom
- Stretching content
Images are used on web pages all across the internet. They’re used in the form of application icons, corporate logos, and photos of you and your friends. It’s been quite a while since I’ve seen even a regular forms-over-data application that didn’t have images in the UI somewhere. Obviously, bitmap-based images have become a mainstay of application design.
Naturally, Silverlight includes mechanisms for displaying this content through the Image element and the MultiScaleImage control.
In addition to displaying images, Silverlight includes the powerful ability to create images from scratch or from other elements using the WriteableBitmap type. You can even use the WriteableBitmap to provide support for formats not natively supported in Silverlight (such as .GIF).
In this chapter, we’ll start with the basics of imaging with the Image element. From there, we’ll move on to creating images on the fly using the WriteableBitmap. Once we have a handle on the WriteableBitmap, we’ll turn to Silverlight’s answer to enormous gigapixel-level images or collections of images-Deep Zoom with the MultiScaleImage control. Finally, we’ll wrap up the chapter with a discussion of the different ways of stretching content to fit the space allotted.