sud*_*-rf 36 iphone cocoa-touch
我正在拍摄我的屏幕并使用它来操纵它UIGraphicsGetImageFromCurrentImageContext().一切都很好.然而,在iPhone 4上,分辨率看起来很破旧,因为它使用的图像似乎是标准分辨率,而不是@ 2x.有没有办法提高结果图像的分辨率?
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)
Mar*_*ote 90
您应该使用UIGraphicsBeginImageContextWithOptions哪个允许您设置比例因子.使用比例因子0.0f来使用设备的比例因子.