首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我需要弄清楚如何使用DeepZoomTools.dll创建DZI

我需要弄清楚如何使用DeepZoomTools.dll创建DZI
EN

Stack Overflow用户
提问于 2014-07-18 22:31:43
回答 2查看 639关注 0票数 2

我不熟悉.NET编码。

但是,我必须在共享服务器上创建DZI切片图像资产,并且被告知我可以实例化和使用DeepZoomTools.dll。

有没有人可以给我看一个非常简单的DZI创建脚本来演示正确的.NET编码技术?我可以根据需要进行修饰,我相信,但不知道从哪里开始。

假设我有一个jpg,脚本如何简单地将其切片并保存?

我可以想象这只是几行代码。服务器正在运行IIS 7.5。

如果有人有一个简单的例子,我将不胜感激。

谢谢

EN

回答 2

Stack Overflow用户

发布于 2014-07-22 07:16:09

我不知道我自己,但你可能会在OpenSeadragon社区中问:

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

那里可能有人知道。

一定要是DeepZoomTools.dll吗?有许多其他选项可用于创建DZI文件。下面是一些例子:

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

票数 1
EN

Stack Overflow用户

发布于 2016-01-16 08:36:38

从多个图像构建Seadragon图像的示例。在这种情况下,"clsCanvas“对象和集合几乎可以忽略不计,它是我的代码内部的一个对象,它使用GDI+生成图像,然后将它们放到磁盘上。下面的代码只是展示了如何从文件中获取一堆图像,并将它们组装成一个可缩放的集合。希望这对某些人有帮助:-)。

代码语言:javascript
运行
复制
 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);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24827484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档