【发布时间】:2014-06-13 13:05:17
【问题描述】:
我想截取窗口的屏幕截图并将该图像用作新视图控制器的背景视图。我的问题是,该图像在视网膜显示中有些模糊,因为图像应该是 640X1136。但是下面的代码返回的图片尺寸只有320X568。
注意:如果我使用苹果的私有 API UIGetScreenImage(),它会返回尺寸为 640X1136 的图像。
-(UIImage*)getScreenShot:(CALayer*)layer
{
UIGraphicsBeginImageContextWithOptions(layer.frame.size, NO, 0.0);
[layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
[self getScreenShot:self.window.layer];
有什么方法可以在不使用苹果私有 API 的情况下获得 640X1136 尺寸的屏幕截图?
【问题讨论】:
标签: ios uiimageview screenshot