【发布时间】:2014-02-04 10:57:40
【问题描述】:
-drawViewHierarchyInRect:afterScreenUpdates: 是 iOS 7 中的 fast way,用于获取视图层次结构的快照。
它拍摄快照,但分辨率为@1x。在 iPhone 5S 上,这些快照看起来像素化且模糊。我创建快照的视图没有被转换。
我不想模糊它,我想要在屏幕上看到的高质量。 这是我如何捕捉它的:
UIGraphicsBeginImageContext(self.bounds.size);
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
我也试过了:
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, self.contentScaleFactor);
仍然以低@1x 质量呈现。
是否有另一种方法来配置图像上下文,使其达到@2x 分辨率?
【问题讨论】:
标签: ios iphone ipad ios7 core-graphics