// 开启图形上下文
UIGraphicsBeginImageContextWithOptions(image.size, NO, 0);
// 剪裁
UIBezierPath *path=[UIBezierPath bezierPathWithArcCenter:CGPointMake(image.size.width*0.5, image.size.height*0.5) radius:image.size.width*0.5 startAngle:0 endAngle:M_PI*2 clockwise:YES];
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
[path addClip];
//绘制图片
[image drawAtPoint:CGPointZero];
// 从上下文中获取剪裁好的图片
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
// 关闭图形上下文
UIGraphicsEndImageContext();