WPF 画布中形状的可见性变化
当画布平移或缩放时,当画布中的形状(具有使用 Translatetransform/ScaleTransform 的缩放和平移控件)变得可见/不可见时,是否可以引发任何事件?
任何有关执行此操作的方法的线索都会有所帮助,我们将不胜感激。谢谢!
Is there any event that can be raised when a shape in a Canvas(which has zoom and pan controls using Translatetransform/ScaleTransform) becomes visible/invisible when the canvas is panned or zoomed?
Any leads on ways to do this will be helpful and is appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你的意思是滚动查看器内的画布?
不,不存在这样的事件,因为画布不知道可见部分。就画布而言,一切都是可见的。
您应该能够通过监听比例、平移变化,然后根据画布中的对象检查滚动查看器的可见视口来自己完成此操作。
I assume you mean a canvas inside a scrollviewer?
No, there is no such event as the canvas is unaware of the visible part. As far as the canvas is concerned everything is always visible.
You should be able to do this yourself by listening to scale,pan changes and then checking the visible viewport of the scrollviewer against your objects in your canvas.