Create Deep Zoom in Code by anton

Silverlight Deep Zoom is the fastest, smoothest, zooming technology on the Web, bringing the highest resolution images and frame rates with the lowest load times to users. Deep Zoom also enables the display of thousands of items simultaneously, giving designers and developers new opportunities to create innovative navigation paradigms for both applications and the Web.

By optimizing the way images are stored and intelligently downloading only the pieces of information needed to fill the screen, Deep Zoom removes technical barriers and enables the delivery of engaging customer and content-centric experiences.

The file format used by Deep Zoom (as well as Photosynth and Seadragon Ajax) is XML based. You can specify a single large image (dzi)[3] or a collection of images (dzc)[4]. It also allows for “Sparse Images”; where some parts of the image have greater resolution than others, an example of which can be found on the Seadragon Ajax home page; The bike image displayed is a sparse image.[5] Though used in the proprietary Deep Zoom, the dzi format is open and able to be used by anyone.

Deep Zoom Image(dzi)

A DZI has two parts: a DZI file (with either a .dzi or .xml extension) and a subdirectory of image files. Each folder in the image subdirectory is labeled with its level of resolution. Higher numbers correspond to a higher resolution level[6]; inside each folder are the image tiles corresponding to that level of resolution.

Deep Zoom Collection(dzc)

A DZC is a collection of some number of DZIs linked and referenced by a DZC file (with either a .dzc or .xml extension). At a high level, a Collection is a number of image thumbnails whose location is kept track of by the .dzc/.xml file, as you zoom into an image, it accesses greater resolutions tiles. A DZC’s structure is similar to that of a DZI; the .dzc/.xml file defines the collection and the subdirectory of folders maps to the DZI file structure, each with their set of .dzi/.xml and image tiles. The DZC is used in Microsoft’s Pivot, but not in SeaDragon.

Sparse Images

Sparse Images (like the bike image above) are a sub-classification of the DZI file type. As in the bike image, a sparse image is normally a number of separate photographs with varying resolution levels that have been placed in a single DZI instead of a DZC. Sparse Images have no different file structure than that of a DZI and differ only in that there is not a single “highest resolution” level for the entire DZI.

We are using Deep Zoom Composer to create this kind of collections, but can we do it in code? The answer is: yes! In Deep Zoom Composer directory, which is by default, [Program Files]\Microsoft Expression\Deep Zoom Composer, you will see a file called DeepZoomTools.dll. This DLL contains all of the functionality needed for you to generate image tiles for compositions and collections. It’s pretty simple to use. Documentation about the class methods and fields located here.

Pay attention to CollectionCreator class and Create method. It creates a Deep Zoom Collection from the list of images and writes it to the destination file. Each item in the list is an Image object representing either an already created Deep Zoom Image or a regular image in a bitmap format such as JPEG, PNG, HD Photo, TIFF, or BMP.

You can use Image and ImageCreator classes to load the images into collections. In addition you can crete sparse Deep Zoom Collections with SparseImageCreator. Seadragon currently transfered all description from their website to the Silverlight.Net. DLL is available with executables from which all described methods are easy to use.format such as JPEG, PNG, HD Photo, TIFF, or BMP.

You can use Image and ImageCreator classes to load the images into collections.