iOS Bezier Curve Method explained

Source: Internet
Author: User

1, according to a rectangular drawing curve

+ (Uibezierpath *) Bezierpathwithrect: (cgrect) rect

2, according to the rectangular frame of the inscribed circle Draw curve

+ (Uibezierpath *) Bezierpathwithovalinrect: (cgrect) rect

3, according to the curve of the rectangular drawing with rounded corners

+ (Uibezierpath *) Bezierpathwithroundedrect: (cgrect) Rect Cornerradius: (cgfloat) Cornerradius

4, in the rectangle, you can have a corner in the corners of the fillet, generally used to set a view of the top two corners of the circle

+ (Uibezierpath *) Bezierpathwithroundedrect: (cgrect) rect byroundingcorners: (uirectcorner) Corners cornerRadii: ( Cgsize) cornerradii

Parameters:

Corners: Enumeration value, you can select a corner

Cornerradii: size of rounded corners

5. Draw an arc with a center point + (Uibezierpath *) Bezierpathwitharccenter: (cgpoint) Center radius: (cgfloat) Radius startangle: (cgfloat ) startangle Endangle: (cgfloat) endangle clockwise: (BOOL) clockwise;

Parameters:

Center: The coordinates of the ARC's central point

Radius: radius of the circle in which the arc is located

StartAngle: The angle value at which the arc starts

Endangle: Angle value for arc end

Clockwise: Whether to draw an arc clockwise

6, draw two Yuan curve, general and movetopoint with use

-(void) Addquadcurvetopoint: (cgpoint) endPoint controlpoint: (cgpoint) ControlPoint

Parameters:

EndPoint: The end of the curve

ControlPoint: Drawing a datum point of a curve

7, with three points to draw a curve, general and movetopoint with the use of

-(void) Addcurvetopoint: (cgpoint) endPoint controlPoint1: (cgpoint) controlPoint1 ControlPoint2: (cgpoint) ControlPoint2

Parameters:

EndPoint: The end of the curve

ControlPoint1: Draw the first datum point of a curve

ControlPoint2: Draw the second datum point of a curve

iOS Bezier Curve Method explained

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.