【发布时间】:2011-02-17 22:16:42
【问题描述】:
我正在尝试找到在 PathGeometry 中使用的 IsFilled="False" 的等价物,但对于 Path Mini。
您可以看到下面的两条路径是相同的,除了具有几何图形的路径在第二个 <PathGeometry>.<PathGeometry.Figures>.<PathFigure> 中具有 IsFilled="False"。这是所需的行为,但我希望将它用于 Path Mini(即在第一个 <Path> 中)。我查看了文档,但似乎找不到任何内容,因为 Path Mini 似乎不是数字集合。
据我了解,所有形状/几何图形都会在运行时转换为迷你路径,那么有没有办法反映编译后的 XAML 以查看解释器如何将带有 PathGeometry 的形状/几何图形呈现为迷你路径?
<Canvas Background="#FDB" Width="800" Height="600">
<!-- this is the LEFT-HAND Path in the picture above -->
<Path Canvas.Left="100" Canvas.Top="100"
Stroke="#385D8A" StrokeThickness="2" StrokeLineJoin="Round" Fill="#4F81BD"
Data="M0,0L102,0L102,102L0,102Z M46.15,49.01L-73.36,130.99L-96.42,-96.12L109.35,355.18">
</Path>
<!-- this is the RIGHT-HAND Path in the picture above -->
<Path Canvas.Left="300" Canvas.Top="100" Stroke="#385D8A" StrokeThickness="2" StrokeLineJoin="Round" Fill="#4F81BD">
<Path.Data>
<GeometryGroup>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure StartPoint="0,0" IsClosed="True">
<PathFigure.Segments>
<LineSegment Point="102,0" />
<LineSegment Point="102,102" />
<LineSegment Point="0,102" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
<PathGeometry>
<PathGeometry.Figures>
<PathFigure IsFilled="False" StartPoint="46.15,49.01">
<PathFigure.Segments>
<LineSegment Point="-73.36,130.99" />
<LineSegment Point="-96.42,-96.12" />
<LineSegment Point="109.35,355.18" />
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
【问题讨论】:
标签: wpf silverlight path pathgeometry