Drawing on the retina display using CoreGraphics - Image pixelated

ⅰ亾dé卋堺 提交于 2019-12-05 02:17:04

You need to replace UIGraphicsBeginImageContext with

if (UIGraphicsBeginImageContextWithOptions != NULL) {
  UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
} else {
  UIGraphicsBeginImageContext(size);
}

UIGraphicsBeginImageContextWithOptions was introduced in 4.x software. If you're going to run this code on 3.x devices, you need to weak link UIKit framework. If your deployment target is 4.x or higher, you can just use UIGraphicsBeginImageContextWithOptions without any additional checking.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!