Silverlight、DeepZoom 缩放动画
当我在 Silverlight 中设置 Deepzoom 图像的 ViewportWidth 时,缩放级别变化得非常快。有没有办法可以设置这个缩放动画应该花费的时间?
谢谢
When I set the ViewportWidth of a Deepzoom image in Silverlight the zoom level changes very quickly. Is there a way I can set the time this zooming animation should take?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
唯一的方法是将
UseSprings
设置为 false,并自行为ViewportWidth
的值设置动画。如果您想保持平移的“弹簧”动画,这也会迫使您在执行平移操作时对ViewportOrigin
进行动画处理。您需要测试其性能。 MultiscaleImage 很可能会以不同于这些属性在外部进行动画处理的方式优化其自身的动画。
The only way to do that would be to set
UseSprings
to false and animate the value ofViewportWidth
yourself. This will also force you to animate the theViewportOrigin
as well when performing panning operations if you want to maintain the "spring" animation of panning.You would need to test the performance of this. It could well be that MultiscaleImage may optimise its own animations differently than when these properties are being animated externally.
尝试使用 MultiScaleImage.UseSprings = true 和 ZoomAboutLogicalPoint() 方法。
Try using the MultiScaleImage.UseSprings = true and the ZoomAboutLogicalPoint() method.
虽然不能直接设定时间,但每个“Spring”正好需要1.5秒。因此,如果您愿意,您可以保留弹簧,然后计算当前视口宽度与您想要的视口宽度之间的差异,并尝试以这种方式调整计时。话虽这么说,它可能看起来很尴尬,所以你必须先测试一下。
Although you cannot set the timing directly, each "Spring" takes exactly 1.5 seconds. So, if you wanted to, you could leave springs on, and then calculate the difference between the current viewportwidth, the viewport width you want to go to, and try and massage the timing this way. That being said, it may look awkward, so you'd have to test it first.