我使用 CGContextDrawImage 绘制我的设计图像,但它太模糊了。
请帮助我提高它的质量。
我用这个来画画:
//NSImage* design_image
两种尺寸都相同,我用它来插值
CGContextRef ct_ref=[context CGContext];
CGContextSetAllowsAntialiasing(ct_ref, YES);
CGContextSetShouldAntialias(ct_ref, YES);
CGContextSetInterpolationQuality(ct_ref, kCGInterpolationHigh);
id hints = [NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:NSImageInterpolationDefault] forKey:NSImageHintInterpolation];
CGImageRef img_ref=[design_image CGImageForProposedRect:&image_dr_rct context:context hints:hints];
CGContextDrawImage(ct_ref, CGRectMake(image_dr_rct.origin.x, image_dr_rct.origin.y, image_dr_rct.size.width, image_dr_rct.size.height), img_ref);