Please help me!!! How create a rounded inflated square UIImageView. I need to create icons as a contact such as in the viber application . Sample image
I Asked about rounded INFLATED square, And i think questions have a different.
Please help me!!! How create a rounded inflated square UIImageView. I need to create icons as a contact such as in the viber application . Sample image
I Asked about rounded INFLATED square, And i think questions have a different.
The easy way to do it is to use a mask and apply it to your image.
- (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage {
CGImageRef maskRef = maskImage.CGImage;
CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
CGImageGetHeight(maskRef),
CGImageGetBitsPerComponent(maskRef),
CGImageGetBitsPerPixel(maskRef),
CGImageGetBytesPerRow(maskRef),
CGImageGetDataProvider(maskRef), NULL, false);
CGImageRef masked = CGImageCreateWithMask([image CGImage], mask);
return [UIImage imageWithCGImage:masked];
}
See this tutorial : http://iosdevelopertips.com/cocoa/how-to-mask-an-image.html#comment-47347
And the stackoverflow topic about your issue: How to Mask an UIImageView
Possible duplicate here: Draw iOS 7-style squircle programatically
Anyway, what you want is a squircle/superellipse. Read up on the uibezierpath and customize the curves bigger for your usage.