、、、
UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(20, 100, 100, 100)];
UIImage *anotherImage = [UIImage imageNamed:@"landscape.jpg"];
UIGraphicsBeginImageContextWithOptions(imageview.bounds.size, NO, 1.0);
[[UIBezierPath bezierPathWithRoundedRect:imageview.bounds cornerRadius:50] addClip];
[anotherImage drawInRect:imageview.bounds];
imageview.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.view addSubview:imageview];
、、、
网友评论