将图片缩放(质量和比例变化)

– (UIImage *)resizeImage:(UIImage *)image

withQuality:(CGInterpolationQuality)quality

rate:(CGFloat)rate

{

UIImage *resized =nil;

CGFloat width = image.size.width * rate;

CGFloat height = image.size.height * rate;

UIGraphicsBeginImageContext(CGSizeMake(width, height));

CGContextRef context =UIGraphicsGetCurrentContext();

CGContextSetInterpolationQuality(context, quality);

[imagedrawInRect:CGRectMake(0,0, width, height)];

resized = UIGraphicsGetImageFromCurrentImageContext();

UIGraphicsEndImageContext();

return resized;

}

,爱情唯美短句子

将图片缩放(质量和比例变化)

相关文章:

你感兴趣的文章:

标签云: