Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 图元上的多个几何图形剪辑_C#_Geometry_Clip_Uielement - Fatal编程技术网

C# 图元上的多个几何图形剪辑

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

我正在使用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.Clip = myClipEllipse; // circle of radius 30, centered on myRectangle

现在,myClipEllipse将覆盖myPath.Clip中的myClipRect,因此只显示myClipEllipse。我正在寻找一个结果,该结果可以正确地使用这两个剪辑绘制我的矩形(即,不反转)。

我最终使用
GeometryGroup
类()解决了这个问题。只需将所有几何体作为
GeometryGroup
的子对象,并将此
GeometryGroup
赋给剪辑即可