本文介绍了如何在多尺度图像顶部添加图形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将图形添加到多尺度图像。我使用Deep Zoom Composer在创建多尺度图像时自动生成的项目。
我试过这个,并将图形添加到maincanvas,没有任何结果:
< Grid>
< Canvas Name =maincanvas/>
< MultiScaleImage />
< / Grid>编辑:当用户放大多尺度图像时,用户可以在图像上放置几何图形。例如。将一个矩形放置在图像中的人物旁边,这将充当发言气球。我知道这可以在缩放图像之前在图像上完成,但是我想动态地做到这一点。
遵循教程,以及然后使用以下代码,可以在multiscaleimage的顶部绘图。
< Grid x:Name =LayoutRoot >
< MultiScaleImage x:Name =deepZoomObjectSource =source / dzc_output.xml/>
< Canvas>
< / Canvas>
< / Grid>
I want to add graphics to a multiscaleimage. I use the project that Deep Zoom Composer auto generated when creating a multiscaleimage. Displaying the multiscaleimage from VS2008 works.
I've tried this and added the graphics to the maincanvas, without any results:
<Grid>
<Canvas Name="maincanvas"/>
<MultiScaleImage/>
</Grid>
Edit: When the user zooms in on the multiscaleimage, the user can place geometrically figures on the image. E.g. place a rectangle next to a person in the image, which will act as a speech balloon. I know this can be done on the image before the image is scaled, but I would like to do it dynamically.
解决方案
By following the tutorial at link text, and then using the following code, made it possible to draw on top of the multiscaleimage.
<Grid x:Name="LayoutRoot">
<MultiScaleImage x:Name="deepZoomObject" Source="source/dzc_output.xml"/>
<Canvas>
<Line X1="10" Y1="100" X2="80" Y2="30" Stroke="Red" StrokeThickness="20" Canvas.Top="-16" Canvas.Left="238"></Line>
</Canvas>
</Grid>
这篇关于如何在多尺度图像顶部添加图形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!