The simplest way to resize an UIImage?

前端 未结 30 3236
迷失自我
迷失自我 2020-11-21 22:38

In my iPhone app, I take a picture with the camera, then I want to resize it to 290*390 pixels. I was using this method to resize the image :

UIImage *newI         


        
30条回答
  •  执笔经年
    2020-11-21 22:43

    If you want to make a thumbnail of a UIImage (with proportional resizing or maybe some cropping involved), check out UIImage+Resize category that allows you to use concise, ImageMagick-like syntax:

    UIImage* squareImage       = [image resizedImageByMagick: @"320x320#"];
    

提交回复
热议问题