Created
September 11, 2014 10:06
-
-
Save mamaz/70901e6aaecd09d268fb to your computer and use it in GitHub Desktop.
Draw Circle Image by Clipping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// draw circler image | |
-(void)drawClippedAvatar:(UIImage *)image inRect:(CGRect)rect andContext:(CGContextRef)context | |
{ | |
CGMutablePathRef path = CGPathCreateMutable(); | |
CGPathAddEllipseInRect(path, NULL, rect); | |
CGContextAddPath(context, path); | |
CGContextClip(context); | |
CGPathRelease(path); | |
[image drawInRect:rect]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment