标签:ios
iOS上直接缩小UIImageView的大小会产生锯齿,可以先将其缩放后再使用.
- (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size { UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); [img drawInRect:CGRectMake(0, 0, size.width, size.height)]; UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return scaledImage; }
标签:ios
原文地址:http://181911195.blog.51cto.com/10596332/1693135