要改变图片的尺寸,iphone中有一个很巧妙的方法,具体内容如下:
翻译自:http://stackoverflow.com/questions/2079543/how-do-i-reduce-image-quality-size-in-iphone-objective-c
你首先建立一个新的图形环境(graphics context),在其上画一个图片(注意,图片的尺寸就是想要的尺寸)。返回的图片就是你想要的图片。代码如下:
UIGraphicsBeginImageContext(CGSizeMake(480,320)); CGContextRef context = UIGraphicsGetCurrentContext(); [image drawInRect: CGRectMake(0, 0, 480, 320)]; UIImage *smallImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();翻译自:http://stackoverflow.com/questions/2079543/how-do-i-reduce-image-quality-size-in-iphone-objective-c
本文介绍了一种在iPhone中调整图片尺寸的方法。通过创建新的图形环境并指定目标尺寸,可以有效地改变图片大小。此方法适用于Objective-C开发环境。

被折叠的 条评论
为什么被折叠?



