得到剪切的图片

 

- (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;

}

posted @ 2013-06-06 16:52  xiaoxiaoxigua  阅读(175)  评论(0编辑  收藏  举报