How to resize image?

I took the image from UIImagePickerController, but the file looks too large to be portable over the Internet, I would like to resize the image. I could not find any method related to the image process.

Any recommendation?

+3
source share
1 answer

You can create the context of the desired size using UIGraphicsBeginImageContext(), then draw the image in the context using the UIImage method -drawInRect:and finally use UIGraphicsGetImageFromCurrentImageContext()to pull out the new UIImage.

+5
source

Source: https://habr.com/ru/post/1698870/


All Articles