【发布时间】:2012-09-07 18:58:46
【问题描述】:
我正在尝试使用UIImage 的drawInRect: 方法绘制图像。代码如下:
UIImage *image = [UIImage imageNamed:@"OrangeBadge.png"];
UIGraphicsBeginImageContext(image.size);
[image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)];
UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
问题是生成的图像模糊。这是与源图像(左侧)相比的结果图像(右侧):
CGContextSetAllowsAntialiasing(UIGraphicsGetCurrentContext(), NO)CGContextSetShouldAntialias(UIGraphicsGetCurrentContext(), NO) 都试过了,但都没有解决问题。
有什么想法吗?
提前致谢。
【问题讨论】:
标签: ios uikit uiimage antialiasing