Creating Deep Zoom Images through c# code

In this quick post, I will show you the creation of deep zoom images from 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 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.

Very first you need to include DeepZoomTools dll as a reference in your project.

Add namespace

clip_image001

Next you need to create Container and set the basic properties as below,

clip_image003

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.

clip_image005

In last step you need to create deep zoom images using the create method of CollectorCreator

clip_image006

For reference 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);
}

&nbsp;

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

 

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.

Dhananjay Kumar is Developer, Blogger , Speaker, Learner , Mindcracker & Microsoft MVP.

Tagged with: , , ,
Posted in Silververlight
2 comments on “Creating Deep Zoom Images through c# code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

  • I just want to create an App not a rocket science program .. why this separate VM this and that for WP8 emulator ? Big fail #Fail 10 minutes ago
  • seems whole world is conspiring against my webinar tomorrow .. This is last thing I epxpected now why you are not working ? :( 3 hours ago
  • what is this security group and all ? being fan of WP only question why so many complexities product group ? 3 hours ago
  • dude I tell you this Windows Phone 8 SDK and emulator is pain ... u crash systems ? 3 hours ago
  • RT @brij_bhushan: #Blogged WCF Hands on Lab – Csharp Corner Delhi Chapter event : A Very Successful day wp.me/pT2AF-jc cc @debug_mo4 hours ago
Categories
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my current or previous employer's view in anyway. © Copyright 2013
Follow

Get every new post delivered to your Inbox.

Join 2,133 other followers

%d bloggers like this: