C#:dzi图像创建opensedragon

时间:2013-08-27 12:08:51

标签: c# seadragon

我有关于dzi图像创建的问题。我在C#中使用以下代码生成dzi图像。

public string GetGenetatedImage()
{

    ImageCreator creator = new ImageCreator();

    creator.TileFormat = ImageFormat.Png;
    creator.TileOverlap = 1;
    creator.TileSize = 256;

    string RootPath = HttpContext.Current.Server.MapPath("~/Images/new.png");


    List<string> files = new List<string>()
    {               
       RootPath

    };
    string root = HttpContext.Current.Server.MapPath("~/Images/GeneratedImagesnewGrid/");


    List<string> dzi = new List<string>();
    foreach (var name in files)
    {
        string output = Path.Combine(root, Path.GetFileNameWithoutExtension(name) + ".dzi");
        dzi.Add(output);
        creator.Create(name, output);
    }

    CollectionCreator ccreator = new CollectionCreator();
    ccreator.TileFormat = ImageFormat.Png;
    ccreator.TileOverlap = 1;
    ccreator.TileSize = 256;
    ccreator.Create(dzi, Path.Combine(root, "da.dzc"));

    string rtvalue = HttpContext.Current.Server.MapPath("~/Images/GeneratedImagesLighthouse/newGrid.dzi");

    return rtvalue;

}

我正在使用DeepZoomTools。

我的输入文件是here

获得的输出i是here

我的输出文件似乎丢失了文件。 “

客户端代码:

   OpenSeadragon({
                    id:             "example-zoomit-tilesource",
                    prefixUrl:       "openseadragon/images/",
                    defaultZoomLevel:        1,
                    minZoomLevel:         1,
                    maxZoomLevel:         3,
                    visibilityRatio:         0.3,
                    tileSources:   [{
                                    Image: {
                                            xmlns:    'http://schemas.microsoft.com/deepzoom/2008',
                                            Url:      "http://***.net/Content/img/GeneratedImagesnewGrid555/last5_files/",
                                            Format:   'png',
                                            Overlap:  "0", 
                                            TileSize: "256",
                                            ServerFormat: "Default",
                                    Size: { 
                                        Width: "5816",
                                        Height: "3961"
                                    }
                                           },


                                  },
                             ]
                });

我在这里做错了吗?我无法找到为什么我的输出文件丢失。

请帮忙, 感谢。

1 个答案:

答案 0 :(得分:1)