美文网首页
UIBezierPath 圆角

UIBezierPath 圆角

作者: 曾柏超 | 来源:发表于2018-03-16 08:14 被阅读0次
    
    
        // Begin a new image that will be the new image with the rounded corners
        // (here with the size of an UIImageView)
        UIGraphicsBeginImageContextWithOptions(_imagV.bounds.size, NO, 1.0);
        
        // Add a clip before drawing anything, in the shape of an rounded rect
        [[UIBezierPath bezierPathWithRoundedRect:_imagV.bounds
                                    cornerRadius:50.0] addClip];
        // Draw your image
        [_imagV.image drawInRect:_imagV.bounds];
        
        // Get the image, here setting the UIImageView image
        _imagV.image = UIGraphicsGetImageFromCurrentImageContext();
        
        // Lets forget about that we were drawing
        UIGraphicsEndImageContext();
        
    

    相关文章

      网友评论

          本文标题:UIBezierPath 圆角

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