美文网首页
2022-06-13(图片切割圆角)

2022-06-13(图片切割圆角)

作者: ImmortalSummer | 来源:发表于2022-06-13 10:43 被阅读0次
///图片切割圆角
- (UIImage *)clipImageCornerRadius:(UIImage *)image{
    UIGraphicsBeginImageContextWithOptions(image.size, NO, 0);
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height);
    CGContextAddEllipseInRect(ctx, rect);
    CGContextClip(ctx);
    [image drawInRect:rect];
    UIImage *imageNew = UIGraphicsGetImageFromCurrentImageContext();
    return imageNew;
}

https://blog.csdn.net/smaller_coder/article/details/79363616

相关文章

网友评论

      本文标题:2022-06-13(图片切割圆角)

      本文链接:https://www.haomeiwen.com/subject/erkomrtx.html