iphone,当使用“ renderInContext”保存图像时设备上的图像模糊? [英] iphone, when saving image with "renderInContext" to device, the image is blurry?

查看:288
本文介绍了iphone,当使用“ renderInContext”保存图像时设备上的图像模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码从视图渲染图像。
然后我将其保存到相册。
图像模糊吗?
为什么?有解决方案吗?

I'm using this code to render an image from view. Then i am saving it to photo album. The image is blurry? Why? Is there a solution?

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

Tnx全部。

推荐答案

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

You are propably using a retina device, Change the following

UIGraphicsBeginImageContext(self.view.bounds.size)

UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, self.view.opaque, 0.0);

这篇关于iphone,当使用“ renderInContext”保存图像时设备上的图像模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆