- UIGraphicsBeginImageContext(CGSizeMake(width_, width_));
- CGContextRef ctx = UIGraphicsGetCurrentContext();
- CGContextMoveToPoint(ctx, 20, 20);
- CGContextSetFillColorWithColor(ctx, color.CGColor);
- //画圆
- CGContextAddArc(ctx, width_/2, width_/2, 14.5, 0, 6.3, 0);
- CGContextFillPath(ctx);
- //取得图片
- self->pickedColorImageView.image = UIGraphicsGetImageFromCurrentImageContext();
- UIGraphicsEndImageContext();
- //该片段来自于http://www.codesnippet.cn/detail/051220137812.html
来源: http://www.codesnippet.cn/detail/051220137812.html