UIBezierPath and CGContext class, uibezierpath

Source: Internet
Author: User

UIBezierPath and CGContext class, uibezierpath
UIBezierPath and CGContext

CGContextSetLineWidth (ctr, 10); // describes and fills the edge
CGContextDrawPath (ctr, kCGPathFillStroke );


UIBezierPath and CGContext
VoidCGContextSetLineWidth (CGContextRef c, CGFloat width); // you can specify the width of an edge.
VoidCGContextAddLineToPoint (CGContextRef c, CGFloat x, CGFloat y); // Add a line to a certain point
VoidCGContextSetLineCap (CGContextRef c, CGLineCap cap); // you can specify the style at the end of a line segment header.
VoidCGContextSetLineJoin (CGContextRef c, CGLineJoin join); // you can specify the line segment turning point style.
VoidCGContextSetRGBStrokeColor (CGContextRef context, CGFloat red,
CGFloat green, CGFloat blue, CGFloat alpha); // set the color.

+ (UIBezierPath *) bezierPath; // create UIBezierPath
+ (UIBezierPath *) bezierPathWithRect :( CGRect) rect; // create a quadrilateral voidCGContextAddRect (CGContextRef c, CGRect rect)

+ (UIBezierPath *) bezierPathWithOvalInRect :( CGRect) rect; // create a circular voidCGContextAddEllipseInRect (CGContextRef context, CGRect rect)
+ (UIBezierPath *) Configure :( CGRect) rect cornerRadius :( CGFloat) cornerRadius; // create an arc round (CGContextRef c, CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise)

+ (UIBezierPath *) bezierPathWithRoundedRect :( CGRect) rect byRoundingCorners :( UIRectCorner) corners cornerRadii :( CGSize) cornerRadii; // create a weird Quadrilateral
+ (UIBezierPath *) bezierPathWithArcCenter :( CGPoint) center radius :( CGFloat) radius startAngle :( CGFloat) startAngle endAngle :( CGFloat) endAngle clockwise :( BOOL) clockwise; // create an arc, it can be clockwise or counterclockwise.
+ (UIBezierPath *) bezierPathWithCGPath :( CGPathRef) CGPath;

-(Void) moveToPoint :( CGPoint) point; // you can specify the start point.
-(Void) addLineToPoint :( CGPoint) point; // Add a line to a certain point
-(Void) addArcWithCenter :( CGPoint) center radius :( CGFloat) radius startAngle :( CGFloat) startAngle endAngle :( CGFloat) endAngle clockwise :( BOOL) clockwise; // Add an arc, it can be clockwise or counterclockwise.
-(Void) closePath; // close path (connection start point and last point)
Void CGContextClosePath (CGContextRef c)

Related Article

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.