Eureka
1

// 加载图片
UIImage *img = [UIImage imageNamed:@"165a2965fb1d8727"];
// 边框宽度
CGFloat borderW = 10;
// 确定边框宽度
CGSize size = CGSizeMake(img.size.width + 2 * borderW, img.size.height + 2 * borderW);
// 开启上下文
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
// 绘制大图,显示出来
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, size.width, size.height)];
[[UIColor blueColor] setFill];
[path fill];
// 绘制小圆,设置裁剪区域
UIBezierPath *clipPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(borderW, borderW, img.size.width, img.size.height)];
[clipPath addClip];
// 把图片绘制到上下文中
[img drawAtPoint:CGPointMake(borderW, borderW)];
// 从上下文中获取图片
UIImage *newImg = UIGraphicsGetImageFromCurrentImageContext();
// 关闭上下文
UIGraphicsEndImageContext();
// 显示到页面中
self.imgView.image = newImg;