我试着画一个正方形,上面有一个圆孔,这样人们就可以看到长方形后面是什么。我在WPF中使用了以下代码来实现这一点:
<Path Grid.Row="0" Grid.Column="1" Stretch="Uniform" Stroke="Black" Fill="Yellow">
<Path.Data>
<CombinedGeometry GeometryCombineMode="Exclude">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,100,100"></RectangleGeometry>
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<EllipseGeometry Center="50,50" RadiusX="40" RadiusY="40"></EllipseGeometry>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Path.Data>
</Path>CombinedGeometry类似乎不存在于WinRT-XAML中。基本上,我想创建一个游戏棋盘,你从顶部将棋子放入其中,并将棋子落到棋盘后面的地方。
有什么建议我应该用什么来代替CombinedGeometry呢?或者关于如何让CombinedGeometry在WinRT-XAML中工作的建议?
谢谢!戴夫
发布于 2014-03-17 18:05:52
它不是真正的等价物,但它可以完成以下工作:
<!-- Creates a composite shape from three geometries. -->
<GeometryGroup FillRule="EvenOdd">
<LineGeometry StartPoint="10,10" EndPoint="50,30" />
<EllipseGeometry Center="40,70" RadiusX="30" RadiusY="30" />
<RectangleGeometry Rect="30,55 100 30" />
</GeometryGroup>
</Path.Data>
https://stackoverflow.com/questions/21207767
复制相似问题