Swift: UIGraphicsBeginImageContextWithOptions scale factor set to 0 but not applied
€8-30 EUR
Κλειστή
Αναρτήθηκε πάνω από 7 χρόνια πριν
€8-30 EUR
Πληρωμή κατά την παράδοση
I used to resize an image with the following code and it used to work just fine regarding the scale factor. Now with Swift 3 I can't figure out why the scale factor is not taken into account. The image is resized but the scale factor not applied. Do you know why?
let layer = [login to view URL]
UIGraphicsBeginImageContextWithOptions([login to view URL], true, 0)
[login to view URL](in: UIGraphicsGetCurrentContext()!)
let scaledImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
print("SCALED IMAGE SIZE IS (scaledImage!.size)")
print(scaledImage!.scale)
For example if I take a screenshot on iPhone 5 the image size will be 320*568. I used to get 640*1136 with exact same code.. What can cause the scale factor not to be applied?
When I print the scale of the image it would print 1, 2 or 3 based on the device resolution but will not be applied to the image taken from the context.
Hi ,, We are Group of Professionals & Skilled Developers.
Have been working here from past 4 years, with 180+ satisfied Clients & 100+ apps.
Kindly review our Profile & Portfolio once.
Thanks
Dear, Manager.
I think you are going to paint some images.
For this, you can use Begin and EndContext.
If you are looking for a talented and reliable developer, I am just a right person.
You can prove my skills and abilities via interview and this project.
Thanks for your consideration.
Best regards.
Ion.