let user crop image in iOS
问题 Is there a built in function in objective-c to do image cropping like the one in iOS photo gallery? I have tried enabling editing in UIImagePickerController, but it doesn't do the same. Thanks! 回答1: there are quite a few ways to crop images using the Core Graphics functions, the most basic one would be: CGRect cropRect = CGRectMake(0, 0, 100, 100); CGImageRef cropped_img = CGImageCreateWithImageInRect(yourUIImage.CGImage, cropRect) 回答2: This is no built in function. The way to do it would be