skip to Main Content

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

https://graphicdesign.stackexchange.com/questions/35579/create-a-rounded-inflated-square-in-illustrator-photoshop

I Asked about rounded INFLATED square, And i think questions have a different.

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search