1. 开启图形上下文,指定尺寸,不透明,缩放参数为0,即根据当前屏幕自动缩放 UIGraphicsBeginImageContextWithOptions(image.size,NO,0);
2.描述裁剪路径
UIBezierPath*path = [UIBezierPathbezierPathWithOvalInRect:CGRectMake(0,0, image.size.width, image.size.height)];
3.设置裁剪区域
[path addClip];
4.绘图
[imagedrawAtPoint:CGPointZero];
5.获取绘制后的图片内容
image =UIGraphicsGetImageFromCurrentImageContext();
5.关闭上下文
UIGraphicsEndImageContext();