I've read some posts which recommend the use of:
UIGraphicsBeginImageContextWithOptions((image.size), NO, 0.0f)
instead of:
UIGraphicsBeginImageContext(image.size).
Because the first one uses Retina-scale when drawing, otherwise you get blocky images.
I'm a little confused about when to use or not the retina-scale option.
If i have a photograph which is 1000x1000 px, and i call UIGraphicsBeginImageContext passing those dimensions, am i not specifying exactly how many points i want to draw? Is that ok?
Or should i call UIGraphicsBeginImageContextWithOptions passing half the dimensions (500x500px)? Does it make any difference?
You can create the image context like this:
UIGraphicsBeginImageContextWithOptions(size, false, UIScreen.main.scale)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With