ARTICLE

Creating Deep Zoom Images from Image through C# code in Azure

Posted by Dhananjay Kumar Articles | Windows Azure September 21, 2011
In this quick post, I will show you the creation of deep zoom images from an Image in Azure BLOB.
Reader Level:

In this quick post, I will show you the creation of deep zoom images from an Image in Azure BLOB. You may come with a requirement where you need to create deep zoom images using code. If you need deep zoom images for a Pivot Viewer you can very much create it using several tools available. However you may have to create deep zoom images using code in some scenario. I am going to share code snippet for the same.

  1. First you need to include the DeepZoomTools dll as a reference in your project.
     
  2. Add namespace

    Deep Zoom Images from image through C# code
     
  3. Next you need to create Container and set the basic properties as below,

    Deep Zoom Images from image through C# code
     
  4. Next create list of images you want to convert as deep zoom image. For purpose of this post, I am taking only one image. That image is in Azure Blob. So for that I am giving URL of the Image saved in azure Blob. You can choose image from local storage as well.

    Deep Zoom Images from image through C# code
     
  5. In the last step you need to create deep zoom images using the create method of CollectorCreator

    Deep Zoom Images from image through C# code

For reference, the full source code is as below,

protected void Button1_Click(object sender, EventArgs e)
{
 
    string directoryToSaveDeepZoomImages = "D:\\abc";

    CollectionCreator collectionCreator = new CollectionCreator();
    collectionCreator.TileSize = 256;
    collectionCreator.TileFormat = Microsoft.DeepZoomTools.ImageFormat.Png;
    collectionCreator.ImageQuality = 1.0;
    collectionCreator.TileOverlap = 0;

    List<Microsoft.DeepZoomTools.Image> images =
                new List<Microsoft.DeepZoomTools.Image>();
    images.Add(new Microsoft.DeepZoomTools.Image("azuerbloburlforimage"));         

    collectionCreator.Create(images, directoryToSaveDeepZoomImages);

}

In this way you can create deep zoom images. I hope this post was useful. Thanks for reading.

If you find my posts useful you may like to follow me on twitter http://twitter.com/debug_mode  or may like Facebook page of my blog http://www.facebook.com/DebugMode.Net  If you want to see post on a particular topic please do write on FB page or tweet me about that, I would love to help you.

Login to add your contents and source code to this article
post comment
     

is it possible to generate sparseimagescenegraph.xml from dynamic deep zoom in other way, need to know how to get the x,y,bottomx,bottomy positions of the image so that we can deep link it or add some overlay on top of every image.

Posted by Y K Apr 06, 2012
COMMENT USING
PREMIUM SPONSORS
Over-C is a holistic consortium of communications and technology specialists. We build, deploy and market both business as well as consumer products and solutions.
Get Career Advice from Experts
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.