【发布时间】:2013-03-30 22:46:13
【问题描述】:
在我的应用中,用户可以使用以下代码从库中选择一张照片。因为我希望用户裁剪照片,所以我确保 setAllowsEditing:YES。
当您选择照片时,您可以移动和缩放图像,但是当稍后查看图像 (selectedImage) 时,图像会恢复到其原始大小???
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"];
【问题讨论】: