C# 图元上的多个几何图形剪辑
我正在使用C#、Silverlight、Visual Studio for Windows Phone 7 是否有方法提供一个C# 图元上的多个几何图形剪辑,c#,geometry,clip,uielement,C#,Geometry,Clip,Uielement,我正在使用C#、Silverlight、Visual Studio for Windows Phone 7 是否有方法提供一个ui元素多个几何体片段?相当于: Path myPath = new Path(); myPath.Data = myRectangle; // say of size 100x100 myPath.Clip = myClipRect; // smaller rectangle, say of size 20x20, located at (0,0) myPath.Cli
ui元素
多个几何体片段?相当于:
Path myPath = new Path();
myPath.Data = myRectangle; // say of size 100x100
myPath.Clip = myClipRect; // smaller rectangle, say of size 20x20, located at (0,0)
myPath.Clip = myClipEllipse; // circle of radius 30, centered on myRectangle
现在,myClipEllipse将覆盖myPath.Clip中的myClipRect,因此只显示myClipEllipse。我正在寻找一个结果,该结果可以正确地使用这两个剪辑绘制我的矩形(即,不反转)。我最终使用
GeometryGroup
类()解决了这个问题。只需将所有几何体作为GeometryGroup
的子对象,并将此GeometryGroup
赋给剪辑即可