Better quality image from UIGraphicsGetImageFromCurrentImageContext()

前端 未结 2 1279
后悔当初
后悔当初 2021-01-01 20:26

I\'m currently using UIGraphicsGetImageFromCurrentImageContext() to save a content\'s image to a user\'s camera roll, but the image quality is worse than if

相关标签:
2条回答
  • 2021-01-01 21:15

    Instead of using UIGraphicsBeginImageContext you should be using:

    UIGraphicsBeginImageContextWithOptions(size, NO, 0);
    
    0 讨论(0)
  • 2021-01-01 21:17

    If you're on retina display the size of the context is only half the size of the "real" image.

    Try to double the size (or to be correct use the contentScaleFactor of the view).

    0 讨论(0)
提交回复
热议问题