以下只是简单的context实现,因为不常用,所以记录一下
<span style="white-space:pre"> </span>let context = UIGraphicsGetCurrentContext()
// 圆
/*
CGContextAddArc(context, 200, 200, 100, 0, -3.141592653*2, 1)
CGContextSetFillColorWithColor(context, UIColor.redColor().CGColor)
CGContextFillPath(context)
CGContextAddArc(context, 200, 200, 100, 0, -3.141592653*2, 1)
CGContextSetLineWidth(context, 5)
CGContextStrokePath(context)
*/
// 椭圆
/*
CGContextAddEllipseInRect(context, CGRect(x: 100, y: 400, width: 200, height: 100))
CGContextSetFillColorWithColor(context, UIColor.redColor().CGColor)
CGContextFillPath(context)
CGContextAddEllipseInRect(context, CGRect(x: 100, y: 400, width: 200, height: 100))
CGContextSetLineWidth(context, 5)
CGContextStrokePath(context)