2016-10-21 1 views
0

WPF beginner here ...この3番目のパスがキャンバスにレンダリングされないのはなぜですか?

このXAMLドキュメントの3番目のパスがウィンドウに表示されない理由を説明してください。第1と第2のパスは必要に応じてレンダリングされますが、第3のパスはレンダリングされません。

<Canvas> 
    <Path Stroke="Blue" StrokeThickness="5" Canvas.Top="20"> 
     <Path.Data> 
      <PathGeometry> 
       <PathFigure StartPoint="10, 10"> 
        <BezierSegment Point1="130,30" Point2="40,140" Point3="150,150"></BezierSegment> 
       </PathFigure> 
      </PathGeometry> 
     </Path.Data> 
    </Path> 
    <Path Stroke="Green" StrokeThickness="2" StrokeDashArray="5 2" Canvas.Top="20"> 
     <Path.Data> 
      <GeometryGroup> 
       <LineGeometry StartPoint="10,10" EndPoint="130,30"></LineGeometry> 
       <LineGeometry StartPoint="40,140" EndPoint="150,150"></LineGeometry> 
      </GeometryGroup> 
     </Path.Data> 
    </Path> 

    <!-- This path is not being rendered for some reason --> 
    <Path Fill="Red" StrokeThickness="8" Canvas.Top="20"> 
     <Path.Data> 
      <GeometryGroup> 
       <EllipseGeometry Center="130 30"></EllipseGeometry> 
       <EllipseGeometry Center="40 140"></EllipseGeometry> 
      </GeometryGroup> 
     </Path.Data> 
    </Path> 
</Canvas> 

答えて

1

あなたはストローク= "赤" を欠けている:

<Path Fill="Red" Stroke="Red" StrokeThickness="8" Canvas.Top="20"> 
    <Path.Data> 
    <GeometryGroup> 
     <EllipseGeometry Center="130 30"></EllipseGeometry> 
     <EllipseGeometry Center="40 140"></EllipseGeometry> 
    </GeometryGroup> 
    </Path.Data> 
</Path> 

また、このように試すことができます:

<Path Fill="Blue" Stroke="Red" StrokeThickness="2" Canvas.Top="20"> 
    <Path.Data> 
    <GeometryGroup> 
     <EllipseGeometry Center="130 30" RadiusX="5" RadiusY="5"></EllipseGeometry> 
     <EllipseGeometry Center="40 140" RadiusX="5" RadiusY="5"></EllipseGeometry> 
    </GeometryGroup> 
    </Path.Data> 
</Path> 
+0

はい私は。ありがとうございました。 – brian

関連する問題