Square thumbnail from UIImagePickerViewController image

后端 未结 4 1961
春和景丽
春和景丽 2020-12-24 08:34

In my app the user selects an image or take a picture using UIImagePickerViewController. Once the image was selected I want to display its thumbnail on a square UIImageView

4条回答
  •  再見小時候
    2020-12-24 09:02

    Here is a link you can refer to:

    1) UIImage+Resize

    2) UIImage+ProportionalFill

    Here you can resize the view and also add proportional fill so that proportionately the aspect ratio and other functions like crop, scale, etc.

    You can use -(UIImage*)resizedImageToSize:(CGSize*)size method under reference link UIImage+Resize above just to reize the image.

    Hope this helps you.

    Let me know if you want more help.

提交回复
热议问题