When I present a UIImagePickerController in my iPhone App, it always comes up with a white square with a frame around it, and the user has can zoom in and out of an image and make it fit within the white square. Whatever they fit in the white square is what is returned to:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)info
and it is always 640x640.
Why can't the user select an entire image? Why does this white square even come up?
Built in editing is very limited. Here is what the Apple documentation says:
Editing controls To specify whether the camera interface should offer the user controls for moving and scaling the captured picture, or for trimming the captured movie, set the
allowsEditing
property toYES
(to provide editing controls) or toNO
.When using built-in editing controls, the image picker controller enforces certain options. For still images, the picker enforces a square cropping as well as a maximum pixel dimension. For movies, the picker enforces a maximum movie length and resolution. If you want to let the user edit full-size media, or specify custom cropping, you must provide your own editing UI.
Make sure you're not enable editing for the UIImagePickerController. You just need this:
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagePicker setDelegate:self];
[controller presentModalViewController:imagePicker animated:YES];
[imagePicker release];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With