美文网首页
CoreGraphic 基本使用

CoreGraphic 基本使用

作者: d5cbd4f07363 | 来源:发表于2019-04-10 14:48 被阅读0次

1.绘制线条

- (void)drawRect:(CGRect)rect

{

      CGContextRefcontext =UIGraphicsGetCurrentContext();

//设置上下文使用的颜色

[[UIColor  yellowColor] set];

CGContextSetLineWidth(context,4.0);

CGContextSetShadowWithColor(context,CGSizeMake(10.0f,10.0f),20.0f, [UIColorredColor].CGColor);

CGContextSetLineCap(context, kCGLineCapRound);

CGContextMoveToPoint(context,50.0,200.0);

CGContextAddLineToPoint(context,50.0,400.0);

CGContextAddLineToPoint(context,250.0,400.0);

CGContextClosePath(context);//开始绘制CGContextStrokePath(context);

}

相关文章

网友评论

      本文标题:CoreGraphic 基本使用

      本文链接:https://www.haomeiwen.com/subject/qriniqtx.html