Extensible Templates in Deep Zoom Composer

July 19th, 2009     |     9 Comments

In the previous post, I started talking about some of the collection-related improvements we made in Deep Zoom Composer. The crux of that post was describing how you can defer to the Silverlight application the task of arranging and positioning your images.

Deep Zoom Composer ships with one basic template, based on my earlier Tag Browser, that handles simple arrangement of like-sized images during runtime. Of course, there are many more things that you may want to do beyond just having items be arranged in a grid. You may want to arrange them circularly. You may even choose to go scattershot like one of the layouts you have in DeepZoomPix:

scattershot

Beyond just the layout of the images, you have access to several pieces of metadata in the scene.xml and metadata.xml files!

Essentially, there are a lot of things that you can do that our default templates simply do not expose in Deep Zoom Composer (DZC). To help solve that problem, we made the process of selecting a template from within DZC extensible:

dzc_dropdown

While we currently ship with three templates, you can easily add your own. This post will describe briefly the two types of templates you can add.

Template Without Source Files/Project
To simply provide your own template, all you need is an HTML file named test.html and the corresponding XAP that is used to display your Deep Zoom images. Your Deep Zoom Images will be in GeneratedImages/dzc_output.xml relative to your XAP.

Note: The test.html file needs to have the appropriate tags to actually display the XAP file.

Once you have your HTML file and XAP file, you will have to find the Deep Zoom Composer installation directory. By default, that is found under Program Files/Microsoft Expression/Deep Zoom Composer. Once there, find the folder named Export Templates. You will see three folders whose name matches the name of the templates you see in the above screenshot:

folders_export

In this location, add a new folder whose name will be what you want to have showing up inside the templates drop-down in DZC. I am going to name my folder Kirupa’s Template:

folders_new

Once I have created this folder, I simply paste my HTML file named test.html and corresponding XAP file into it.

xap_html

After doing all of this, if I restart Deep Zoom Composer, switch to the Custom tab under Export, and expand the templates drop-down menu, notice that Kirupa’s Template now appears:

extensible_template

When you export with your chosen template, your HTML file and XAP will be copied along with the GeneratedImages folder that contains the various XML files and Deep Zoom image tiles:

kirupaTemplateGeneratedImages

If you find yourself stuck, you can always look at how the Tag Browser and Default templates inside your Export Templates are laid out.

Template With Source Files/Project
In the previous section, I explained how to add your own custom template with just an HTML and XAP file. There will be cases where what you want to use involves source files. For example, you may create a generic template that does something really cool with the various metadata files we generate. The actual look of the application is something that you would want a more technically/design savvy end-user to modify instead.

For those cases, an HTML file and XAP file are grossly inadequate. What you need to be able to provide is both the HTML file and XAP along with the source files associated with it. To add your custom template that includes source files, the steps are a little similar to the general XAP + HTML case. What is different is what DZC expects in terms of folder names and project locations.

Note: For reference, look at how the project under Deep Zoom Classic + Source are laid out.

Inside your Export Templates folder, create a folder whose name is what you want your template to be known as.

Next, create a new Silverlight project using Expression Blend 3 named DeepZoomProject, this solution and folder structure is created for you. When you build your application, you will basically see the following structure:

folder_images

If you compare this directory with what you see in your Deep Zoom Classic + Source folder, you will see that almost everything is identical:

export_project

The only thing that is missing in what you created in Blend and what DZC expects is a GeneratedImages folder in your ClientBin directory living alongside your XAP. You can add this folder easily using Blend 3 by right-clicking on the ClientBin folder and selecting Add New Folder:

addNewFolder

All that is left after you add your new folder is to rename it to GeneratedImages to make DZC happy:

generatedImages_2

Once you have your project done, just copy and paste your DeepZoomProject Solution file, the DeepZoomProject folder, and the DeepZoomProjectSite folder into the folder you created under DZC’s Export Templates directory. The folder you paste your source files into must contain the word Source as part of its name. For example, my folder is called Kirupa’s Template + Source:

source_folder_name

Conclusion
This post wraps up my coverage of the new Export-related features we now have inside Deep Zoom Composer. Hopefully this post and the previous post help you create the really nice Deep Zoom collections and visuals that you had always wanted to do easily.

Cheers!
Kirupa :)

9 Responses to “Extensible Templates in Deep Zoom Composer”

  1. antal Says:

    please more as3!

  2. kirupa Says:

    antal – there is plenty of AS3 here: http://www.kirupa.com/developer/flash/index.htm !!!!

    I will be writing more about Silverlight and Blend 3 for the next couple of weeks because there is a lot of things our team did that is just too cool to not share.

    :P

  3. Neil Says:

    Is there any chance that you could point me in the direction of the Headlight Authoring Tool that is referenced in scene.xml?

  4. kirupa Says:

    Hi Neil – that is actually Deep Zoom Composer. Headlight was an internal prototype of a variant of Deep Zoom Composer :)

  5. Deep Zoom Composer 正式版发布! « 每日IT新闻,最新IT资讯,聚合多站点消息,保证你与世界同步 Says:

    [...] 更多关于导出特性,可以看这两篇博客:Extensible Templates in Deep Zoom Composer, Improved Collection Support in Deep Zoom Composer [...]

  6. Deep Zoom Composer リリース! | KGRAND ONLINE NEWS Says:

    [...] and/or, if you want to find out more about the new exporting features, Kirupa’s blog posts about Extensible Templates in Deep Zoom Composer and Improved Collection Support in Deep Zoom Composer. They will continue to blog more about some [...]

  7. Deep Zoom Composer 1.0 released | Ramoonus.nl Says:

    [...] a bit more about our new exporting features, check out Kirupa’s two blog posts on this topic: Extensible Templates in Deep Zoom Composer and Improved Collection Support in Deep Zoom [...]

  8. Maulnet Says:

    http://spyhistory.ru – Спасибо за объяснение. Я не знал этого.

  9. balaji balasubramanian Says:

    hi kirupa .,

    i seen your blog & other things its reallly superb.,

    i m new to blend 3,silverlight..

    my boss told me to create one button in blend and include in existing asp.net project..

    i m struggling to do this …

    i know how to create button in xaml file .. but i dont know how to embedd in my existing .net project..

    can u suggest me how to do this .,

    i think from your name shows ur tamilan right ….

    i feel happy to hear your position in microsoft…

    plz mail me @ vellore.balaji@gmail.com

Leave a Reply