问题
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 to take the image an get a frame around the portion of the image you want.
This question should help you
来源:https://stackoverflow.com/questions/9529743/let-user-crop-image-in-ios