-->

iphone,节约用“renderInContext”图像设备时,图像是模糊的?(iphone, w

2019-09-18 12:50发布

我使用这个代码,以使从视图中的图像。 那么我将其保存到相册。 该图像是模糊的? 为什么? 有没有解决的办法?

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

TNX所有。

Answer 1:

您propably使用视网膜设备,更改以下

UIGraphicsBeginImageContext(self.view.bounds.size)

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


文章来源: iphone, when saving image with “renderInContext” to device, the image is blurry?