Deep Zoom Batch Export (Programmatically using C#)
[UPDATE: You can find an updated version of this library here]
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.
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).
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:
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.
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?
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…