UIBezierPath和CGContext类中的方法

 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)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值