WPF: is it possible to render a circle using GeometryDrawing?

后端 未结 2 355
星月不相逢
星月不相逢 2020-12-11 16:20

I\'ve got a GeometryDrawing similar like this:



        
相关标签:
2条回答
  • 2020-12-11 17:01
    ....
    <GeometryDrawing Brush="Black">
        <GeometryDrawing.Geometry>
            <EllipseGeometry Center="0,0" RadiusX="1" RadiusY="1" />
        </GeometryDrawing.Geometry>
    </GeometryDrawing>
    

    Alternatively, you can also use Path Markup Syntax to draw two elliptic arcs (upper and lower half of the circle):

    <GeometryDrawing Brush="Black" Geometry="M -1,0 A 1,1 0 1 1 1,0 M -1,0 A 1,1 0 1 0 1,0" />
    
    0 讨论(0)
  • 2020-12-11 17:17
    <Path Stretch="Fill" 
          Fill="Transparent" 
          Stroke="Black" 
          StrokeThickness="5" 
          Data="M 0,0 A 180,180 180 1 1 1,1 Z"/>
    
    0 讨论(0)
提交回复
热议问题