没有降低图片质量情况下修改图片大小

+(UIImage*)scale:(UIImage*)image toSize:(CGSize)size
{
UIGraphicsBeginImageContextWithOptions(size,NO,0.0);//用这个方法替代UIGraphicsBeginImageContext(size)
[image drawInRect:CGRectMake(0,0, size.width, size.height)];
UIImage*scaledImage =UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return scaledImage;
}

posted on 2012-10-17 17:07  kiao295338444  阅读(211)  评论(0编辑  收藏  举报

导航