iphone,当用"renderInContext"将图像保存到设备时,图像模糊不清?

Sha*_*hay 8 iphone blurry save photolibrary

我正在使用此代码从视图中呈现图像.然后我将它保存到相册.图像模糊吗?为什么?有解决方案吗?

UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)

Tnx全部.

Oma*_*ith 20

您可以使用视网膜设备,更改以下内容

UIGraphicsBeginImageContext(self.view.bounds.size)
Run Code Online (Sandbox Code Playgroud)

UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);
Run Code Online (Sandbox Code Playgroud)