图片分割

- (UIImage *)clipImage: (UIImage *)image inRect: (CGRect) rect

{//返回image中rect范围内的图片

    CGImageRef imageRef = CGImageCreateWithImageInRect(image.CGImage, rect);

    UIImage *subImage = [UIImage imageWithCGImage:imageRef];

    return subImage;

}

原文地址:https://www.cnblogs.com/y16879w/p/4432686.html