1

I have an image created and I want to draw a ellipse or circle on it with parameters X coordinates, Y coordinates, Width and Height. I've search on google and found out that you can't draw inside a UI Image View.

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tom.jpg"]];

[self.view addSubview:imageView];

And can I add a filter effect like blur inside where I draw the ellipse or circle?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user2951348
  • 113
  • 1
  • 1
  • 7
  • Try to check this [link][1] . It may be helpful to you [1]: http://stackoverflow.com/questions/19388061/ios-uibezierpath-and-cashapelayer-fillrule – Tendulkar Apr 15 '14 at 07:28

1 Answers1

1

Refer this well explained article : http://www.appcoda.com/ios-programming-circular-image-calayer/

Creating a Circular Profile Image :

self.profileImageView.layer.cornerRadius = self.profileImageView.frame.size.width / 2;
self.profileImageView.clipsToBounds = YES;

Adding Border :

self.profileImageView.layer.borderWidth = 3.0f;
self.profileImageView.layer.borderColor = [UIColor whiteColor].CGColor;

Creating Rounded Corner Image :

self.profileImageView.layer.cornerRadius = 10.0f;
Rajeev
  • 4,762
  • 8
  • 41
  • 63