Uibezierpath through
-(void) Addarcwithcenter: (cgpoint) Center radius: (cgfloat) Radius startangle: (cgfloat) startangle endangle: (cgfloat) Endangle clockwise: (BOOL) clockwise
You can draw an arc.
Look at the meaning of each parameter:
Center: coordinates of Center point
Radius: Radius
StartAngle: The starting Radian
Endangle: Arc-End Radian
Clockwise:yes is clockwise, no is counterclockwise
The main method is to understand startangle and Endangle, just at the beginning I do not know where a circular arc from the beginning and end, such as the radian is 0, is from up and down which point to start counting
Look at the picture below and it's clear.
See 0Pi is the right side of the circle to start calculating, clockwise to m_pi/2,m_pi,m_pi*1.5
You know, it's easy to draw an arc with Bezierpath.
For example, to draw the bold paragraph is:
[HTML]View PlainCopy
- Uibezierpath *Path = [[Uibezierpath alloc] init];
- [Path Addarcwithcenter:center
- Radius:radius
- startangle:m_pi*1.1
- endangle:m_pi*1.9
- Clockwise:yes];
Uibezierpath the record of drawing arcs