我陷入了一个问题,我正在创建图像,它的大小约为 350 * 350,但我想将该图像调整为 32 * 32 或 16 * 16 之类的小图像,我正在使用此代码执行此操作
UIImage *scaledImage=img_Clip;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(16, 16),NO,0.0);
// Turn off interpolation to keep the scaled image from being blurred.
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
[scaledImage drawInRect:CGRectMake(0, 0, 16, 16)]; // scales image to rect
UIImage *resImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
但是我没有得到想要的结果我的图像变得模糊我尝试了很多东西但没有任何工作请帮助我