码迷,mamicode.com
首页 > 其他好文 > 详细

UIBezierPath和CGContext类中的方法

时间:2014-12-07 23:15:57      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:uibezierpath和cgconte

 UIBezierPath和CGContext类中的方法

    CGContextSetLineWidth(ctr, 10);
     // 即描写边线又填充
   
CGContextDrawPath(ctr, kCGPathFillStroke);


UIBezierPath和CGContext类中的方法

void CGContextSetLineWidth(CGContextRef c, CGFloat width); // 设置边线的宽度
void CGContextAddLineToPoint(CGContextRef c, CGFloat x, CGFloat y); // 添加一条线到某一个点
void CGContextSetLineCap(CGContextRef c, CGLineCap cap);  // 设置线段头尾部的样式
void CGContextSetLineJoin(CGContextRef c, CGLineJoin join); // 设置线段转折点的样式
void CGContextSetRGBStrokeColor(CGContextRef context, CGFloat red,
  CGFloat green, CGFloat blue, CGFloat alpha); 
// 设置颜色

+ (UIBezierPath *)bezierPath; // 创建UIBezierPath

+ (
UIBezierPath *)bezierPathWithRect:(CGRect)rect; // 创建一个四边形
void CGContextAddRect(CGContextRef c, CGRect rect) 

+ (
UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect; // 创建一个圆形
void CGContextAddEllipseInRect(CGContextRef context, CGRect rect)

+ (
UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect cornerRadius:(CGFloat)cornerRadius; // 创建弧形
void CGContextAddArc(CGContextRef c, CGFloat x, CGFloat y, CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise)

+ (
UIBezierPath *)bezierPathWithRoundedRect:(CGRect)rect byRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii; // 创建怪异的四边形
+ (
UIBezierPath *)bezierPathWithArcCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise; // 创建弧形,可以按照顺时针或者逆时针
+ (
UIBezierPath *)bezierPathWithCGPath:(CGPathRef)CGPath;

- (void)moveToPoint:(CGPoint)point; // 设置起点
- (
void)addLineToPoint:(CGPoint)point; // 添加一条线到某个点
- (
void)addArcWithCenter:(CGPoint)center radius:(CGFloat)radius startAngle:(CGFloat)startAngle endAngle:(CGFloat)endAngle clockwise:(BOOL)clockwise ; // 添加一个弧形,可以按照顺时针或者逆时针

- (
void)closePath; // 关闭路径(连接起点和最后一个点)
void CGContextClosePath(CGContextRef c)

UIBezierPath和CGContext类中的方法

标签:uibezierpath和cgconte

原文地址:http://blog.csdn.net/itcontend/article/details/41792697

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!