我不熟悉.NET编码。
但是,我必须在共享服务器上创建DZI切片图像资产,并且被告知我可以实例化和使用DeepZoomTools.dll。
有没有人可以给我看一个非常简单的DZI创建脚本来演示正确的.NET编码技术?我可以根据需要进行修饰,我相信,但不知道从哪里开始。
假设我有一个jpg,脚本如何简单地将其切片并保存?
我可以想象这只是几行代码。服务器正在运行IIS 7.5。
如果有人有一个简单的例子,我将不胜感激。
谢谢
发布于 2014-07-22 07:16:09
我不知道我自己,但你可能会在OpenSeadragon社区中问:
https://github.com/openseadragon/openseadragon/issues
那里可能有人知道。
一定要是DeepZoomTools.dll吗?有许多其他选项可用于创建DZI文件。下面是一些例子:
http://openseadragon.github.io/examples/creating-zooming-images/
发布于 2016-01-16 08:36:38
从多个图像构建Seadragon图像的示例。在这种情况下,"clsCanvas“对象和集合几乎可以忽略不计,它是我的代码内部的一个对象,它使用GDI+生成图像,然后将它们放到磁盘上。下面的代码只是展示了如何从文件中获取一堆图像,并将它们组装成一个可缩放的集合。希望这对某些人有帮助:-)。
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);
https://stackoverflow.com/questions/24827484
复制相似问题