WPF元素超出了usercontrol [英] WPF element gets out of usercontrol
本文介绍了WPF元素超出了usercontrol的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,我有下一个问题(见图片)
我有一个包含用户控件的窗口。在我的用户控件中,我有一个椭圆,显示在用户控件中,也在其外部(图1)。我只需要显示那个位于用户控件内的部分(图像2)
图片1 [ ^ ]
图片2 [ ^ ]
So, i have next problem (see images)
I have a window that contains a user control. in my user control i have an ellipse that is shown in user control and also outside of it (image 1). i need to show only that part, that is located inside of user control (image 2)
Image 1[^]
Image 2[^]
推荐答案
从你的问题来看,目前还不清楚你是如何使用椭圆在用户控件之外获取图像的。在所有情况下,如图2所示,呈现控件的一种方法是: http://msdn.microsoft.com/en-us/library/system.windows.uielement.cliptobounds%28v=vs.110%29.aspx [ ^ ]。
-SA
From your question, it's not clear how exactly you obtained the image with ellipse going outside of a user control. In all cases, one method to present the control as shown on Figure 2 is this: http://msdn.microsoft.com/en-us/library/system.windows.uielement.cliptobounds%28v=vs.110%29.aspx[^].
—SA
这篇关于WPF元素超出了usercontrol的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文