+ (UIImage *)clipImage:(UIImage *)image withRect:(CGRect)rect {
CGRect clipFrame = rect;
CGImageRef refImage = CGImageCreateWithImageInRect(image.CGImage, clipFrame);
UIImage *newImage = [UIImage imageWithCGImage:refImage];
CGImageRelease(refImage);
return newImage;
}
网友评论