drawInRect: losing Quality of Image resolution

前端 未结 1 850
南笙
南笙 2021-01-01 16:53

I am trying to erase image using following code

 CGColorRef strokeColor = [UIColor whiteColor].CGColor;

 UIGraphicsBeginImageContext(imgForeground.frame.siz         


        
相关标签:
1条回答
  • 2021-01-01 17:50

    You should go with UIGraphicsBeginImageContextWithOptions instead of UIGraphicsBeginImageContext, so that a scale factor can be specified.

    For example, this will use the scale factor of the device's main screen:

    UIGraphicsBeginImageContextWithOptions(imgForeground.frame.size, NO, 0);
    
    0 讨论(0)
提交回复
热议问题