贝塞尔曲线画圆角

来源:互联网 发布:网络武侠剧 编辑:程序博客网 时间:2024/05/22 07:09
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,100,100)]; 
imageView.center =CGPointMake(200,300); 
UIImage *anotherImage = [UIImage imageNamed:@"image"]; 
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];
0 0
原创粉丝点击