我正在使用C#,Silverlight,Visual Studio for Windows Phone 7 .
有没有办法给出 UIElement
多个几何剪辑?相当于:
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 . 我正在寻找一个结果,正确地绘制myRectangle与这两个剪辑(即,不反转) .
1 回答
我最终使用
GeometryGroup
类(docs here)解决了这个问题 . 只需将所有几何图形作为GeometryGroup
的子图形,并将此GeometryGroup
赋予剪辑 .