2

I am not familiar with .NET coding.

However, I must create DZI sliced image assets on a shared server and am told that I can instantiate and use DeepZoomTools.dll.

Can someone show me a very simple DZI creation script that demonstrates the proper .NET coding technique? I can embellish as needed, I'm sure, but don't know where to start.

Assuming I have a jpg, how does a script simply slice it up and save it?

I can imagine it's only a few lines of code. The server is running IIS 7.5.

If anyone has a simple example, I'd be most appreciative.

Thanks

DonCx
  • 53
  • 4

2 Answers2

1

I don't know myself, but you might ask in the OpenSeadragon community:

https://github.com/openseadragon/openseadragon/issues

Someone there might know.

Does it have to be DeepZoomTools.dll? There are a number of other options for creating DZI files. Here are a few:

http://openseadragon.github.io/examples/creating-zooming-images/

iangilman
  • 2,144
  • 1
  • 13
  • 16
0

Example of building a Seadragon Image from multiple images. In this, the "clsCanvas" objects and collection can pretty much be ignored, it was an object internal to my code that was generating the images with GDI+, then putting them on disk. The code below just shows how to get a bunch of images from file and assemble them into a zoomable collection. Hope this helps someone :-).

 CollectionCreator cc = new CollectionCreator();

            // set default values that make sense for conversion options
            cc.ServerFormat = ServerFormats.Default;
            cc.TileFormat = ImageFormat.Jpg;
            cc.TileSize = 256;
            cc.ImageQuality = 0.92;
            cc.TileOverlap = 0;

            // the max level should always correspond to the log base 2 of the tilesize, unless otherwise specified
            cc.MaxLevel = (int)Math.Log(cc.TileSize, 2);

            List<Microsoft.DeepZoomTools.Image> aoImages = new List<Microsoft.DeepZoomTools.Image>();

            double fLeftShift = 0;
            foreach (clsCanvas oCanvas in aoCanvases)
            {

                //viewport width as a function of this canvas, so the width of this canvas is 1
                double fThisImgWidth = oCanvas.MyImageWidth - 1; //the -1 creates a 1px overlap, hides the seam between images.
                double fTotalViewportWidth = fTotalImageWidth / fThisImgWidth;
                double fMyLeftEdgeInViewportUnits = -fLeftShift / fThisImgWidth; ; //please don't ask me why this is a negative numeber
                double fMyTopInViewportUnits = -fTotalViewportWidth * 0.3;
                fLeftShift += fThisImgWidth;

                Microsoft.DeepZoomTools.Image oImg = new Microsoft.DeepZoomTools.Image(oCanvas.MyFileName.Replace("_Out_Tile",""));
                oImg.ViewportWidth = fTotalViewportWidth;
                oImg.ViewportOrigin = new System.Windows.Point(fMyLeftEdgeInViewportUnits, fMyTopInViewportUnits);

                aoImages.Add(oImg);
            }

            // create a list of all the images to include in the collection
            cc.Create(aoImages, sMasterOutFile);
mike
  • 2,149
  • 20
  • 29