我一直在阅读不同的答案,但无法解决此问题:
在我的 iPad 应用程序中,横向模式下,我有一个 UIImagePickerController 来拍照,这个选择器显示在 UIPopoverController 中。
问题是预览和拍照后的图像大小不同
预习:
.
拍照后:
这是我设置选择器和popOver的代码:
BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = hasCamera ? UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary;
picker.modalPresentationStyle = UIModalPresentationFullScreen;
picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
[picker setShowsCameraControls:FALSE];
self.companyPopOverController = [[[UIPopoverController alloc] initWithContentViewController:picker] autorelease];
self.companyPopOverController.passthroughViews=[NSArray arrayWithObject:self.view];
[self.companyPopOverController presentPopoverFromRect:CGRectMake(622, 534, 10, 10) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
并显示拍摄的照片:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image=[info objectForKey:UIImagePickerControllerOriginalImage];
[self.picImage setImage:image];
[self.companyPopOverController dismissPopoverAnimated:YES];
self.imageTaken = YES;
}
那么如何使我的预览图像与实际拍摄的图像大小相同?
谢谢!