UIImage截图失去了它的质量 [英] UIImage screenshot loses its quality

查看:97
本文介绍了UIImage截图失去了它的质量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在合并两张图片然后我通过应用此代码截取屏幕截图:

I am merging two images and then I take a screenshot by applying this code:

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

[dragView removeFromSuperview];
imgV_SelectedImg.image=nil;
imgV_SelectedImg.image=img_AddText;
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);

问题在于,当最终图像质量下降时,它会模糊。

The problem is that when the final image loses its quality it blurs.

推荐答案

尝试使用UIGraphicsBeginImageContext的withOptions版本

Try using the withOptions version of UIGraphicsBeginImageContext

UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);

这篇关于UIImage截图失去了它的质量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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