// 画线
// CGContextRef currentContext = UIGraphicsGetCurrentContext();
//
// [[UIColor redColor] set];
//
// CGContextSetLineWidth(currentContext, 5.0f);
//
// CGContextMoveToPoint(currentContext, 0, 0);
//
// CGContextAddLineToPoint(currentContext, 300, 400);
//
// CGContextSetLineJoin(currentContext, kCGLineJoinBevel);
//
// CGContextAddLineToPoint(currentContext, 300, 0);
//
// CGContextStrokePath(currentContext);
// 根据路径画图
// CGMutablePathRef path = CGPathCreateMutable();
//
// CGRect screenBound = [[UIScreen mainScreen] bounds];
//
// CGPathMoveToPoint(path, NULL, screenBound.origin.x, screenBound.origin.y);
//
// CGPathAddLineToPoint(path, NULL, screenBound.size.width, screenBound.size.height);
//
// CGPathMoveToPoint(path, NULL, screenBound.size.width, screenBound.origin.y);
//
// CGPathAddLineToPoint(path, NULL, screenBound.origin.x, screenBound.size.height);
//
// CGContextRef currentContext = UIGraphicsGetCurrentContext();
//
// CGContextAddPath(currentContext, path);
//
// [[UIColor blueColor] setStroke];
//
// CGContextDrawPath(currentContext, kCGPathStroke);
// 绘制矩形
// CGMutablePathRef path = CGPathCreateMutable();
//
// CGRect rectangle = CGRectMake(50.0f, 50.0f, 200, 200);
//
// CGPathAddRect(path, NULL, rectangle);
//
// CGContextRef currentContext = UIGraphicsGetCurrentContext();
//
// CGContextAddPath(currentContext, path);
//
// [[UIColor redColor] setFill];
//
// [[UIColor blueColor] setStroke];
//
// CGContextDrawPath(currentContext, kCGPathFillStroke);
//
// CGPathRelease(path);
// 绘制多个矩形
// CGMutablePathRef path = CGPathCreateMutable();
//
// CGRect rect1 = CGRectMake(10, 10, 100, 100);
//
// CGRect rect2 = CGRectMake(200, 200, 100, 100);
//
// CGRect rectgroup[2] = {rect1, rect2};
//
// CGPathAddRects(path, NULL, rectgroup, 2);
//
// CGContextRef context = UIGraphicsGetCurrentContext();
//
// CGContextAddPath(context, path);
//
// [[UIColor redColor] setStroke];
// [[UIColor blueColor] setFill];
//
// CGContextSetLineWidth(context, 10);
//
// CGContextDrawPath(context, kCGPathFillStroke);
// 绘制阴影
// CGContextRef currentContext = UIGraphicsGetCurrentContext();
// 保存以前的状态
// CGContextSaveGState(currentContext);
//
// CGContextSetShadowWithColor(currentContext, CGSizeMake(10.0, 10.0f), 5.0f, [[UIColor grayColor] CGColor]);
//
// CGMutablePathRef path = CGPathCreateMutable();
//
// CGRect rect1 = CGRectMake(100, 100, 100 , 100);
//
// CGPathAddRect(path, NULL, rect1);
//
// CGContextAddPath(currentContext, path);
//
// [[UIColor redColor] setFill];
// [[UIColor blueColor] setStroke];
//
// CGContextDrawPath(currentContext, kCGPathFillStroke);
// 恢复原来保存的状态
// CGContextRestoreGState(currentContext)
// 平移
// CGMutablePathRef path = CGPathCreateMutable();
//
// CGRect rect1 = CGRectMake(10, 10, 100, 100);
//
// CGAffineTransform transform = CGAffineTransformMakeTranslation(100.0, 100);
//
// CGPathAddRect(path, &transform, rect1);
//
// CGContextRef currentContext = UIGraphicsGetCurrentContext();
//
// CGContextAddPath(currentContext, path);
//
// [[UIColor redColor] setStroke];
// [[UIColor blueColor] setFill];
//
// CGContextSetLineWidth(currentContext, 5.0f);
//
// CGContextDrawPath(currentContext, kCGPathFillStroke);