none
MultiScaleImage 中动态添加MultiScaleSubImage RRS feed

  • 问题

  • 请问在MultiScaleImage 中可不可以动态添加MultiScaleSubImage,如果可以怎么添加。
    我想做电子地图,需要向电子地图中拖拽一些设备图片。而且希望能实现DeepZoom中的效果,请问还有其他办法吗?谢谢!
    2009年8月25日 7:08

答案

  • 你好,

    我们论坛支持小组有个项目正在进行中,示范了不少微软技术的例子. 在下个月即将发布的例子中会有关于DeepZoomComposer的.会提到这些.下面是介绍的一部分:


    Generate deep zoom content programmatically

    Sometimes, rather than create a pre-configured scene using Deep Zoom Composer, you may want to programmatically generate the scene at runtime.

    There're two solutions. One is to create a custom MultiScaleTileSource class, so you can provide your own source images rather than relying on the dzc_output.xml. This feature will not be demostrated in the sample due to integration issue. You can refer to the Deep Earth sample to see how to create a custom MultiScaleTileSource that receives images from Bing Map.

    The other solution is to generate the content on the server, by using the DeepZoomTools.dll assembly shipped with DeepZoomComposer. To do so, you will first need to create a list of Microsoft.DeepZoomTools.Image objects (note it's not System.Windows.Controls.Image), which describes the source, size, position, etc, of each sub image. Than you can call the CollectionCreator.Create method to create a collection, or call the ImageCreator.Create method to create a composition. If you don't know what values to provide for the size and position, one solution will be use Deep Zoom Composer to generate a sample content where sub images are positioned in a similar way to what you want to render. Then you can calculate the size and position information by parsing the Metadata.xml generated by Deep Zoom Composer.

    The code for this feature can be found in the GenerateDeepZoomService class's CreateDeepZoom method, in the web application (note not in the Silverlight application because we're generating the contents on the server side). A few additional notes: To provide you a better experience when downloading the source images from SkyDrive and generating the deep zoom content, this sample uses a duplex WCF service so that the service can "call" client to provide information of the progress. More information of WCF duplex service will be demostrated in a separate sample in the future, so we don't intend to describe it in this document.

    目前Silverlight的例子还不是很多.我们会逐渐加入. 现有的例子可以在这里下:http://cfx.codeplex.com/


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Need a sample of a technique of Microsoft? Just check out CodeFx first! http://cfx.codeplex.com/
    2009年8月27日 1:47
    版主

全部回复


  • MultiScaleImage 内不能再加MultiScaleImage
    如果您觉得对您有帮助,请在“是否有帮助”点“是”;如果你觉得回复很满意,请“标记为已解答”
    2009年8月26日 2:58
    版主
  • 你好,

    我们论坛支持小组有个项目正在进行中,示范了不少微软技术的例子. 在下个月即将发布的例子中会有关于DeepZoomComposer的.会提到这些.下面是介绍的一部分:


    Generate deep zoom content programmatically

    Sometimes, rather than create a pre-configured scene using Deep Zoom Composer, you may want to programmatically generate the scene at runtime.

    There're two solutions. One is to create a custom MultiScaleTileSource class, so you can provide your own source images rather than relying on the dzc_output.xml. This feature will not be demostrated in the sample due to integration issue. You can refer to the Deep Earth sample to see how to create a custom MultiScaleTileSource that receives images from Bing Map.

    The other solution is to generate the content on the server, by using the DeepZoomTools.dll assembly shipped with DeepZoomComposer. To do so, you will first need to create a list of Microsoft.DeepZoomTools.Image objects (note it's not System.Windows.Controls.Image), which describes the source, size, position, etc, of each sub image. Than you can call the CollectionCreator.Create method to create a collection, or call the ImageCreator.Create method to create a composition. If you don't know what values to provide for the size and position, one solution will be use Deep Zoom Composer to generate a sample content where sub images are positioned in a similar way to what you want to render. Then you can calculate the size and position information by parsing the Metadata.xml generated by Deep Zoom Composer.

    The code for this feature can be found in the GenerateDeepZoomService class's CreateDeepZoom method, in the web application (note not in the Silverlight application because we're generating the contents on the server side). A few additional notes: To provide you a better experience when downloading the source images from SkyDrive and generating the deep zoom content, this sample uses a duplex WCF service so that the service can "call" client to provide information of the progress. More information of WCF duplex service will be demostrated in a separate sample in the future, so we don't intend to describe it in this document.

    目前Silverlight的例子还不是很多.我们会逐渐加入. 现有的例子可以在这里下:http://cfx.codeplex.com/


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. Need a sample of a technique of Microsoft? Just check out CodeFx first! http://cfx.codeplex.com/
    2009年8月27日 1:47
    版主