I am trying to erase image using following code
CGColorRef strokeColor = [UIColor whiteColor].CGColor; UIGraphicsBeginImageContext(imgForeground.frame.siz
You should go with UIGraphicsBeginImageContextWithOptions instead of UIGraphicsBeginImageContext, so that a scale factor can be specified.
UIGraphicsBeginImageContextWithOptions
UIGraphicsBeginImageContext
For example, this will use the scale factor of the device's main screen:
UIGraphicsBeginImageContextWithOptions(imgForeground.frame.size, NO, 0);