objective-cuiimagecgcontextdrawpdfpage

Objective-C: Sharpen images created with CGContextdrawPDFPage


I create UIImages from pdf with CGContextDrawPDFPage.

The quality wasn´t satisfying so I tried

CGContextSetInterpolationQuality(context,kCGRenderingIntentDefault);

and it worked out. But the quality of the resulting images is still not good enough. The image looks totally blurry on the iPad.

How can I increase the quality and sharpen the image a bit?


Solution

  • I could get better results by using

    UIGraphicsBeginImageContextWithOptions

    instead of

    UIGraphicsBeginImageContext

    for beginning the image context.

    The parameter scale set to 0.0 did the trick.