Draw part of a circle

后端 未结 8 941
北海茫月
北海茫月 2020-11-27 04:03

For an iPhone application I want to draw a circle, that is only for an x percentage filled.

Something like this:

8条回答
  •  鱼传尺愫
    2020-11-27 04:41

    Try this:

    CGContextMoveToPoint(the center point)
    CGContextAddLineToPoint(the starting point of the fill path on the circumference)
    CGContextAddArcToPoint(the ending point of the fill path on the circumference)
    CGContextAddLineToPoint(the center point)
    CGContextFillPath
    

提交回复
热议问题