Cgcontextaddarctopoint
The Code is as follows:
[Plain] View plaincopy
- Cgcontextref context = uigraphicsgetcurrentcontext ();
- Cgcontextsetrgbstrokecolor (context, 1, 0, 1, 1 );
- Cgcontextmovetopoint (context, 150,50 );
- Cgcontextaddlinetopoint (context, 100,80 );
- Cgcontextaddlinetopoint (context, 130,150 );
- Cgcontextmovetopoint (context,); // the starting point of the arc.
- Cgcontextaddarctopoint (context, 100,80, 130,150, 50 );
- Cgcontextstrokepath (context );
Cgcontextmovetopoint (context, 150,50 );//Starting Point of the arc
Cgcontextaddarctopoint (context, 100,80, 130,150, 50 );
From (150,50) (100,80) draw a line and then (100,80) (130,150) draw a line from these two lines (infinitely extending)And radius50. You can determine an arc,
While
Cgcontextaddarc (context, 100,100, 30, 0, m_pi, 1 );
Relatively simple,(100,100) is the coordinate of the center,30 is the radius ,(0,M_pi) is the start and end angles,1 is clockwise,0 is counter-clockwise
From (150,50) (100,80) draw a line and then (100,80) (130,150) draw a line from these two lines (infinitely extending)And radius50 to determine an arc
Cgcontextaddarctopoint and cgcontextaddarc