我正在给我的屏幕拍照并使用UIGraphicsGetImageFromCurrentImageContext()
。一切都运转良好。然而,在 iPhone 4 上,分辨率看起来相当糟糕,因为它使用的图像似乎是标准分辨率,而不是 @2x。有什么方法可以提高生成图像的分辨率吗?
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
你应该使用UIGraphicsBeginImageContextWithOptions
它允许您设置比例因子。使用 0.0f 的比例因子来使用设备的比例因子。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)