0

In my app the user is able to select a photo from the library with the code below. Because I want the user to crop the photo I have made sure that setAllowsEditing:YES.

When you select the photo you can move and scale the image but when the image is viewed later on (selectedImage) the image reverts back to its original size ???

    myPicker = [[UIImagePickerController alloc] init];
    [myPicker setSourceType: UIImagePickerControllerSourceTypePhotoLibrary];
    [myPicker setToolbarHidden:NO];
    [myPicker setAllowsEditing:YES];
     myPicker.delegate = self;

    //this adds mypicker to current view
    [self presentViewController:myPicker animated:YES completion:NULL];


-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
selectedImage = [[UIImage alloc]init];

selectedImage = [info objectForKey:@"UIImagePickerControllerOriginalImage"];

enter image description here

4

1 回答 1

2

you just have to use "UIImagePickerControllerEditedImage" instead of "UIImagePickerControllerOriginalImage".

thanks.

于 2013-03-30T23:09:05.613 回答