得到剪切的图片

 

- (UIImage *)getCroppedImage {

    

    CGRect imageRect = CGRectMake(10,10,100,100);

    UIImage *ima=[UIImage imageNamed:@"2.jpg"];

    CGImageRef imageRef = CGImageCreateWithImageInRect([ima CGImage], imageRect);

    UIImage *result = [UIImage imageWithCGImage:imageRef

                                          scale:1.0

                                    orientation:ima.imageOrientation];

    CGImageRelease(imageRef);

    return result;

}

原文地址:https://www.cnblogs.com/sgdkg/p/3121543.html