iOS Draw lines

Source: Internet
Author: User

//Add a Bezier curveCgcontextmovetopoint (Cgcontext, Max, -);//move to a pointCgcontextaddcurvetopoint (Cgcontext, Max, -, -, -, -, Max);//draw the curve of the Searle, the point accompanies the movement, these three parameters, each 2 is a parameter    1. Point ( Max, -) represents the start point2. Point ( -, -) is represented as a control point3. Point ( -, Max) is indicated as the terminating point//All in all: The tangent of a curve is plotted at the intersection of the control pointCgcontextaddcurvetopoint (Cgcontext, -, Max, -, $, Max, $);//Cgcontextaddcurvetopoint (Cgcontext, Max, $, $, $, $, Max);//Cgcontextaddcurvetopoint (Cgcontext, $, Max, $, -, Max, -);//[[Uicolor Redcolor] setfill];//Fill ColorCgcontextdrawpath (Cgcontext, Kcgpathstroke);//draw on the brush//Cgcontextaddlinetopoint (Cgcontext,,);

 $ ); // Add a line
// Add a rectangle Cgcontextaddrect (Cgcontext, CGRectMake ());

//Add radiansCgcontextaddarc (Cgcontext, -, -, -,3.14/2, the*3.14/ the,1);//1. Origin Point (100,100)//2. Radius//3. Start Radian 3.14/2, 3.14 is pi//4. End Radian 270* 3.14/180//5. Counterclockwise for 1,0 to clockwise//----------Explain the arc of the circle, the radian is calculated in a clockwise direction, then the starting and ending radians are determined, and the radian is determined so that it is easier to draw in the clockwise direction.

Cgcontextclosepath (Cgcontext); // closed Curve

Cgcontextaddellipseinrect (Cgcontext, CGRectMake ()); // to cut an ellipse inside a rectangle is actually relatively simple.

iOS Draw lines

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.