Giorgio Sardo Blog

Senior Director of Windows, Windows Phone & XBOX Technical Evangelism & Development at Microsoft Corporation

Deep Zoom Batch Export (Programmatically using C#)

Deep Zoom Batch Export (Programmatically using C#)

Rate This
  • Comments 16

[UPDATE: You can find an updated version of this library here]

The Deep Zoom composer is a great tool to manually design a composition. It is still in an early stage and I’m sure its team will add lot of interesting new features in the future. lightbulb

Meanwhile…I think that something where it lacks is the possibility to perform a proper batch export, given a lot of images.

SCENARIO: your want to show 500 pictures using DeepZoom. Due to the high number of pictures, you decide to implement a collection and positionate the images at run-time.

Using the batch export feature of the composer, you can only create several single deepzoom composition…and you miss the option to create a collection.

image

Luckily the Deep Zoom application comes with a tool (SparseImageTool.exe) which is installed in the application folder. The tool allow you to create a collection from the command line, giving as parameter the SceneGraph file and the images input folder (plus other interesting parameters).

image

Not too bad...but...what is the SceneGraph.xml file? This file is an xml file containing the layout of our scene, with the following format:

image

We now have all the tools and information to programmaticly create our collection, avoiding the direct use of the UI of the composer. As proof of concept, I created an application to create a Deep Zoom collection using C#, without opening the Deep Zoom Composer UI.

  • The tool take as input the folder containing all the images to convert, the destination folder and the name of the collection. That’s it!!
  • The generated output is a collection where all the images are overlapped in position (0,0) with their original dimension, and the zoom is set to 1. star

image

Source-code of the application is attached at the bottom of this post.

I will move this application to CodePlex as soon as possible, since I believe the community could add more interesting features. Don’t you? smile_wink

PS: Once you exported your collection using this tool, you can start positionating/resizing/… images using C#…I’ll write a new post about this later…

[UPDATE: You can find an updated version of this library here]

Technorati Tags: ,
Attachment: DZBatch.zip