求助,关于silverlight用path或者GeometryGroup的问题

DONGMINGXIAOFU 2014-04-10 10:26:01
我用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>


出现的效果只有上面的那部分,下面的那个相当于三角形的不填充,该怎么画呢?
三条边组合的,两条线段加一段弧组合的。
...全文
189 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
海涵德 2014-04-11
  • 打赏
  • 举报
回复
这样更简洁
  <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="110,40">
                                <PathFigure.Segments>
                                    <ArcSegment Size="50,50" RotationAngle="45" IsLargeArc="False"  SweepDirection="Counterclockwise" Point="40,40"/>
                                    <LineSegment Point="75,75" ></LineSegment>
                                    <LineSegment Point="110,40"></LineSegment>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathGeometry.Figures>
                    </PathGeometry>
                </GeometryGroup>
            </Path.Data>
        </Path>
DONGMINGXIAOFU 2014-04-11
  • 打赏
  • 举报
回复
引用 1 楼 madaming 的回复:

       <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>
                                </PathFigure.Segments>
                            </PathFigure>
                            <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>
太棒了,我试了那么多次,原来需要再加一个PathFigure
海涵德 2014-04-10
  • 打赏
  • 举报
回复

       <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>
                                </PathFigure.Segments>
                            </PathFigure>
                            <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>

8,757

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧