我不熟悉 .NET 编码。
但是,我必须在共享服务器上创建 DZI 切片图像资产,并被告知我可以实例化和使用 DeepZoomTools.dll。
有人可以给我展示一个非常简单的 DZI 创建脚本来演示正确的 .NET 编码技术吗?我可以根据需要进行修饰,我敢肯定,但不知道从哪里开始。
假设我有一个 jpg,脚本如何简单地将其切片并保存?
我可以想象它只有几行代码。服务器正在运行 IIS 7.5。
如果有人有一个简单的例子,我将不胜感激。
谢谢
我不熟悉 .NET 编码。
但是,我必须在共享服务器上创建 DZI 切片图像资产,并被告知我可以实例化和使用 DeepZoomTools.dll。
有人可以给我展示一个非常简单的 DZI 创建脚本来演示正确的 .NET 编码技术吗?我可以根据需要进行修饰,我敢肯定,但不知道从哪里开始。
假设我有一个 jpg,脚本如何简单地将其切片并保存?
我可以想象它只有几行代码。服务器正在运行 IIS 7.5。
如果有人有一个简单的例子,我将不胜感激。
谢谢
我不认识自己,但您可能会在 OpenSeadragon 社区中问:
https://github.com/openseadragon/openseadragon/issues
那里可能有人知道。
必须是 DeepZoomTools.dll 吗?创建 DZI 文件还有许多其他选项。这里有几个:
http://openseadragon.github.io/examples/creating-zooming-images/
从多个图像构建 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);