SIGN UP MEMBER LOGIN:    
ARTICLE

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

Posted by Dhananjay Kumar Articles | Cloud Computing 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
share 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
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Nevron Gauge for SharePoint
Become a Sponsor