,关于silverlight用path或者GeometryGroup的有关问题
求助,关于silverlight用path或者GeometryGroup的问题
我用GeometryGroup组合了一些自己画的图像,我想要的结果是两个部分构成一个扇形。代码如下:
<Path Stroke="Blue" StrokeThickness="3" Fill="Blue" MouseLeftButtonDown="panElement_MouseLeftButtonDown" Name="PanUp">
<Path.Data>
<GeometryGroup >
<LineGeometry StartPoint="40,40" EndPoint="75,75" />
<LineGeometry StartPoint="75,75" EndPoint="110,40" />
<LineGeometry StartPoint="110,40" EndPoint="40,40"/>
<PathGeometry >
<PathGeometry.Figures>
<PathFigure StartPoint="110,40">
<PathFigure.Segments>
<ArcSegment Size="50,50" RotationAngle="45" IsLargeArc="False" SweepDirection="Counterclockwise" Point="40,40"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>
</Path>
出现的效果只有上面的那部分,下面的那个相当于三角形的不填充,该怎么画呢?
三条边组合的,两条线段加一段弧组合的。
------解决方案--------------------
我用GeometryGroup组合了一些自己画的图像,我想要的结果是两个部分构成一个扇形。代码如下:
<Path Stroke="Blue" StrokeThickness="3" Fill="Blue" MouseLeftButtonDown="panElement_MouseLeftButtonDown" Name="PanUp">
<Path.Data>
<GeometryGroup >
<LineGeometry StartPoint="40,40" EndPoint="75,75" />
<LineGeometry StartPoint="75,75" EndPoint="110,40" />
<LineGeometry StartPoint="110,40" EndPoint="40,40"/>
<PathGeometry >
<PathGeometry.Figures>
<PathFigure StartPoint="110,40">
<PathFigure.Segments>
<ArcSegment Size="50,50" RotationAngle="45" IsLargeArc="False" SweepDirection="Counterclockwise" Point="40,40"/>
</PathFigure.Segments>
</PathFigure>
</PathGeometry.Figures>
</PathGeometry>
</GeometryGroup>
</Path.Data>
</Path>
出现的效果只有上面的那部分,下面的那个相当于三角形的不填充,该怎么画呢?
三条边组合的,两条线段加一段弧组合的。
------解决方案--------------------
<Path Stroke="Blue" StrokeThickness="1" Fill="Blue" Name="PanUp">
<Path.Data>
<GeometryGroup FillRule="Nonzero">
<!--<LineGeometry StartPoint="40,40" EndPoint="75,75" />
<LineGeometry StartPoint="75,75" EndPoint="110,40" />
<LineGeometry StartPoint="110,40" EndPoint="40,40"/>-->
<PathGeometry >
<PathGeometry.Figures >
<PathFigure StartPoint="40,40" IsFilled="True" >
<PathFigure.Segments >
<LineSegment Point="75,75" ></LineSegment>
<LineSegment Point="110,40"></LineSegment>