为什么控件可以在其边界框之外绘制?
Here's an example image of what I mean: example
The gray rectangle is the bounding box of a control that draws the blue lines and dots in it's OnRender(...)
method. The red ovals mark places where it happens.
- Why is that possible?
- How can it be avoided?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我的第二个问题的完美答案,至少在使用矩形控件时是这样:
有关 MSDN。
Here's the perfect answer to my second question, at least when using a rectangular shaped control:
More details on the MSDN.
https://msdn.microsoft.com/en -us/library/ms750441(v=vs.100).aspx有关于WPF架构设计的详细信息来回答为什么它是可能的。
为了避免这种情况,您需要使用 clip 属性。
请查看 http://msdn.microsoft。 com/en-us/library/cc189065%28v=VS.95%29.aspx 了解更多详细信息。
https://msdn.microsoft.com/en-us/library/ms750441(v=vs.100).aspx has detailed information about the architectural design of WPF to answer why it is possible.
To avoid it you want to use the clip property of your element.
Check out http://msdn.microsoft.com/en-us/library/cc189065%28v=VS.95%29.aspx for more details.