【问题标题】:Silverlight deep zoom composing issueSilverlight 深度缩放合成问题
【发布时间】:2009-08-09 03:01:50
【问题描述】:

Deep zoom composer 本身就是一个非常好的工具。我想知道是否有任何自动组合方式?例如,我有 100 张图像,我想自动合成为 10 * 10 深度缩放效果。我正在实施后台工作流程并自动组成深度缩放和发布。我更喜欢的输出类型是“图像”和“导出为集合(多个图像)”。

任何参考样本或文件?我正在使用 VSTS2008 + C# + .Net 3.5。

【问题讨论】:

    标签: c# .net silverlight visual-studio-2008 deepzoom


    【解决方案1】:

    查看this post 了解应用程序中包含的 DeepZoomTools.dll。

    【讨论】:

    • 感谢链接提供了有关对象模型的非常丰富的信息,但是作为初学者,有任何可运行的示例吗?
    【解决方案2】:

    有一个很棒的示例项目here,如果你真的想疯狂地以编程方式生成图像/图块,你可以试试this MSDN article 中提到的那种东西。

    我自己并没有找到很多关于 DeepZoomTools.dll 的真实文档,但是我创建了一个小型测试网络服务来将单个上传的图像转换为 Deep Zoom 源。相关代码为:

    public string CreateDeepZoomImage(byte[] abyte, string fileName)
            {
                ImageCreator ic = new ImageCreator();
                string FilePath = Path.Combine(_uploadPath, fileName);
                System.IO.FileStream fs = new System.IO.FileStream(FilePath, System.IO.FileMode.Create);
                fs.Write(abyte, 0, abyte.Length);
                fs.Close();
                FileInfo imageFileInfo = new FileInfo(FilePath);
                string destination = imageFileInfo.DirectoryName + "\\" + imageFileInfo.Name.TrimEnd(imageFileInfo.Extension.ToCharArray()) + "\\output.xml";
                ic.Create(FilePath, destination);
                string returnpath = "/Uploads/" + imageFileInfo.Name.TrimEnd(imageFileInfo.Extension.ToCharArray()) + "/output.xml";
                return returnpath;
            }
    

    返回路径的使用方式如下:

    ZoomImage.Source = new DeepZoomImageTileSource(new Uri(e.Result, UriKind.Relative));
    

    (原谅草率的代码。它确实有效。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多