美文网首页
CGContextRef

CGContextRef

作者: 你飞跃俊杰 | 来源:发表于2019-12-30 11:30 被阅读0次

画纸

CGContextRef context = UIGraphicsGetCurrentContext();

设置

 CGContextSetLineWidth(context, 0.5);//宽?有问题
CGContextSetStrokeColorWithColor(context, [UIColor colorWith0xRGB:0xE3E3E3].CGColor);//颜色

画字

[text drawInRect:CGRectMake(x+1, y-1, width, heigt) withAttributes:txtDic];

画线

CGContextMoveToPoint(context, width*i, 0);//起点
CGContextAddLineToPoint(context, width*i, self.height);//第二个点
CGContextDrawPath(context, kCGPathStroke);/连线

画圆

CGContextAddArc(context, x, y+width/2, width, 0, 2*PI, 0);

画图

[image drawInRect:CGRectMake(60, 400, 60, 60)];
CGContextDrawImage(context, CGRectMake(160, 400, 60, 60), image.CGImage);

相关文章

  • CGContextRef

    /* CoreGraphics - CGContext.h */ /** Graphics state funct...

  • CGContextRef

    CGContextRef An opaque type that represents a Quartz 2D d...

  • CGContextRef

    以前很不喜欢写技术文章,现在越来越喜欢写了,还是古语说得好,好记性不如烂笔头,当自己总是掉入同一个坑之后,发现记笔...

  • CGContextRef

    自定义显示画框的view 画直线 写文字 画弧线 画圆 有填充颜色的圆 画矩形 画扇形,其实就是画圆,设置一下角度。

  • CGContextRef

    什么是 CGConTextRef CGConTextRef相当于一个画布,我们可以在上面画各种各样的图形,而这个画...

  • CGContextRef

    画纸 设置 画字 画线 画圆 画图

  • Quartz2D学习笔记(一):上下文与路径

    CGContextRef currentRef = UIGraphicsGetCurrentContext(); ...

  • Quartz2D学习笔记(三):变换

    CGContextRef currentRef = UIGraphicsGetCurrentContext(); ...

  • 绘制三角形

    CGContextRef context = UIGraphicsGetCurrentContext(); // ...

  • CGBitmapContextCreate返回nil

    CGContextRef ctx = CGBitmapContextCreate( ...

网友评论

      本文标题:CGContextRef

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