@implementation singeImg (SCHCircelImage)
+ (UIImage *)circleImageName:(NSString *)path borderWith:(double)border colorWith:(UIColor *)color
{
UIImage *img=[UIImage imageNamed:path];
UIGraphicsBeginImageContext(img.size );
CGContextRef ctr=UIGraphicsGetCurrentContext();
double radius=img.size.height>img.size.width?(img.size.width/2):(img.size.height/2);
radius/=2;
double centerx=img.size.width/2;
double centery=img.size.height/2;
[color set];
// CGContextSetLineWidth(ctr, border);
CGContextAddArc(ctr, centerx, centery, radius+border, 0, M_PI_2*4, YES);
CGContextFillPath(ctr);
CGContextAddArc(ctr, centerx, centery, radius, 0, M_PI_2*4, YES);
CGContextClip(ctr);
[img drawInRect:CGRectMake(0, 0, img.size.width, img.size.height)];
UIImage *newImg=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImg;
}
@end