How can I draw a circle sector with the ellipse class?

前端 未结 2 502
野趣味
野趣味 2020-12-13 07:15

I would like to make a sector of a circle on WP7. I tried to do this with the ellipse class and I found a lot of solution, which make a gauge or pie chart or something, but

2条回答
  •  一生所求
    2020-12-13 07:57

    You need to do something like this:

    • define a canvas wrapper for ellipse
    • define the visible part of the canvas (clip). For this part you need to use PathGeometry as the Clip to define the slice of the circle you want to be visible. (see link)

      
          
              
                      // define your path here (see link above)
               
      
              
          
      
      

    Alternatively you can use CombinedGeometry to combine a PathGeometry and EllipseGeometry to form the slice. (the link provides a good example of CombinedGeometry)

提交回复
热议问题