tags:

views:

1534

answers:

3

I am using UIImagePicker to take photo and save the photo. But appears the photo it takes was truncated on top and bottom, which was top and bottom menu when UIImagePicker taking the photo. I am wondering how to take the whole screen of the photo.

Thanks.

A: 

Look in the "editingInfo" dictionary that you get back in the didFinishPickingImage: method, if there's a value for the @"Original" key then it's the real, uncropped image (stored as a UIImage object).

From there you can look at the other editingInfo values to see if the user cropped that image, which you can then apply (or take the UIImage passed to you which is the cropped verson). If you are getting an image back from the photo library, the original is not in the dictionary and you only have the image passed in.

Kendall Helmstetter Gelner
A: 

It appears if I set the allowUserEditable to NO, the image will not be truncated. but the image is too big now, I am wondering how to stretch the image to let it fit the screen.

Thanks.

BlueDolphin
+1  A: 

The UIImagePicker crops all images to 320x320 if you allow editing. If you want something sized differently, you'll have to look at the original image and the cropping rect, both in the editingInfo dictionary you get back from the picker. Once you have those, you can resize or re-crop as needed.

August