concept multiscale image in category silverlight

appears as: multiscale image, multiscale images
Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services

This is an excerpt from Manning's book Silverlight 4 in Action: Silverlight 4, MVVM, and WCF RIA Services.

Showing an image within a MultiScaleImage control is nearly identical to showing an image within an Image control. As with the Image control, the only property you need to set to display an image is Source . This property is a MultiScaleTileSource that can be used to reference a file, but this file isn’t a typical image file. Instead, this file is an XML file, known as the Deep Zoom image (DZI) file, that describes a multiscale image. We’ll share more about this file type in a moment; for now, look at how a MultiScaleImage is created in XAML:

<MultiScaleImage x:Name="myMultiScaleImage"
Source="images/dzc_output.xml" />

This shows the XAML to load a relative multiscale image at design time. In the event that you need to load a multiscale image at runtime, you use a DeepZoomImageTileSource instance. This type derives from the abstract base class MultiScaleTileSource, so it can be used at runtime as shown here:

myMultiScaleImage.Source = new DeepZoomImageTileSource(
new System.Uri("images/dzc_output.xml", UriKind.Relative));

This line of code shows how to load a multiscale image at runtime. If the referenced image can’t be found, the MultiScaleImage object’s ImageOpenFailed event will be fired. If the image is found, the ImageOpenSucceeded event will be triggered and the image will be shown. Once this happens, you may consider giving your user the ability to zoom in and out of the high-resolution image.

21.3.4. Deploying multiscale images

The MultiScaleImage control has built-in support for handling XML that details a multiscale image. This type of file can be generated programmatically or by a tool called Deep Zoom Composer. We won’t cover this tool in detail because of its simplistic nature. Once you download and install the tool from the Microsoft Expression website, you can quickly create XML files that can be used by the MultiScaleImage. These files can be generated within the tool by going through a basic wizard. This wizard goes through the following steps: