iOS 切割图片
作者:互联网
1 - (UIImage *)CutImageWithImage:(UIImage *)image withRect:(CGRect)rect 2 { 3 //使用CGImageCreateWithImageInRect方法切割图片,第一个参数为CGImage类型,第二个参数为要切割的CGRect 4 CGImageRef cutImage = CGImageCreateWithImageInRect(image.CGImage, rect); 5 //将切割出得图片转换为UIImage 6 UIImage *resultImage = [UIImage imageWithCGImage:cutImage]; 7 return resultImage; 8 }
转载于:https://www.cnblogs.com/pretty-guy/p/4027156.html
标签:resultImage,CGImage,切割,image,iOS,UIImage,CGRect,图片 来源: https://blog.csdn.net/weixin_33887443/article/details/94287716