【发布时间】:2011-10-06 06:07:16
【问题描述】:
我想裁剪 UIImage 以获得新的纵横比...
bounds 是一个 CGRect,带有(0,0, newwidth, newhigh)...
- (UIImage *)croppedImage:(UIImage *)myImage :(CGRect)bounds {
CGImageRef imageRef = CGImageCreateWithImageInRect(myImage.CGImage, bounds);
UIImage *croppedImage = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
CGSize asd = croppedImage.size;
return croppedImage;
}
随叫随到:
[workImage croppedImage: workImage: CGRectMake(0, 0, newWidth, newHeigh)];
之后“工作图像”的大小与之前相同......
可能出了什么问题?
问候
【问题讨论】:
标签: iphone xcode ipad uiimage crop