When I take a photo using UIImagePickerController, the image is larger than what was visible on the screen ... How can I take a picture / crop it so that it is exactly the same as I saw on the screen?
edit: I will add code to indicate my problem:
- (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType)sourceType { UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext; imagePickerController.sourceType = sourceType; imagePickerController.delegate = self; imagePickerController.showsCameraControls = NO; imagePickerController.allowsEditing = YES; if (sourceType == UIImagePickerControllerSourceTypeCamera) { [[NSBundle mainBundle] loadNibNamed:@"OverlayView" owner:self options:nil]; self.overlayView.frame = imagePickerController.cameraOverlayView.frame; imagePickerController.cameraOverlayView = self.overlayView; //self.overlayView = nil; self.overlayImage.image = self.imageView.image; self.overlayImage.alpha = 0.5; UISlider *slider=[[UISlider alloc]initWithFrame:CGRectMake(60, 80, 200, 30)]; [slider setMaximumValue:1.0]; [slider setMinimumValue:0.0]; [slider setValue:0.5]; [slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged]; if (self.working == TRUE) { [imagePickerController.cameraOverlayView addSubview:self.overlayImage]; [imagePickerController.cameraOverlayView addSubview:slider]; } } self.imagePickerController = imagePickerController; [self presentViewController:self.imagePickerController animated:YES completion:nil]; }
didFinishPickingMediaWithInfo:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [self dismissViewControllerAnimated:YES completion:NULL];
Is it possible to use UIImagePickerControllerEditedImage when imagePickerController.showsCameraControls = NO; ?
ios objective-c uiimagepickercontroller crop
Adam bardon
source share