uiimagepickercontroller

UIImagePickerController Overlay Buttons Not Firing

ⅰ亾dé卋堺 提交于 2019-11-28 10:10:13
问题 I have a UIImagePickerController of type camera when the user lands on a page. I have put a custom camera overlay on top of the UIImagePickerController, but none of the button events are firing. I know most of this code is from a base Apple code, so I am perplexed as to what is happening. @interface TakePhotoViewController : UIImagePickerController <UIImagePickerControllerDelegate, UINavigationControllerDelegate> ... - (void)showImagePickerForSourceType:(UIImagePickerControllerSourceType

Swift 4.2 imagePickerController issue

倖福魔咒の 提交于 2019-11-28 10:07:58
Trying to pass chat client from swift 4 to swift 4.2 and with picker i found trouble. UIImagePickerControllerEditedImage // Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let pickedImage = info[UIImagePickerControllerEditedImage] as? UIImage { self.userProfileImage.contentMode = .scaleAspectFit self.userProfileImage.image = pickedImage } picker.dismiss(animated: true, completion: nil) } The method signature has changed

UIImagePickerController didFinishPickingMediaWithInfo not being called

孤街浪徒 提交于 2019-11-28 09:10:11
问题 I'm having trouble with using a UIImagePickerController. Basically, though the picker is being displayed fine, the UIImagePickerController didFinishPickingMediaWithInfo method is refusing to be called (I've tried NSLogging all the way through, it just doesn't get called). Here's my code (I've defined imgPicker in the header as an UIImagePickerController): -(IBAction)grabImage { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsImageEditing = YES; self.imgPicker

iOS SDK - How to get the status bar back when using UIImagePickerController?

心已入冬 提交于 2019-11-28 09:00:48
As soon as I add a UIImagePickerController sub view to my view the status bar disappears and I can't get it back. Is there any way to keep the status bar visible? UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; [self.view addSubview:imagePicker.view]; [imagePicker viewWillAppear:YES]; [imagePicker viewDidAppear:YES]; [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]; I had to do the same thing in a camera app as well. Apparently, in addition to setting the status bar to not be

How to avoid compression after selecting video from UIImagePickerController in ios

删除回忆录丶 提交于 2019-11-28 08:19:58
I am using UIImagePickerController to select video from Gallery and it compress that video.I want to disable Compression but I don't find the way to do this. I also tried with ELCImagePickerController it is showing video but it is looking like an image only there is no video icon or time duration like it shows in UIImagePickercontroller.How can I do it? Thanks. With iOS 11 you can set the property videoExportPreset to AVAssetExportPresetPassthrough to get the original: if #available(iOS 11.0, *) { picker.videoExportPreset = AVAssetExportPresetPassthrough } The "Video compression..." label just

Changing NavigationBar Title of UIImagePickerController

我只是一个虾纸丫 提交于 2019-11-28 07:45:01
问题 I want to know how we can change the navigation bar title of UIImagePickerController. I tried several ways but couldn't do it. tried the follwing ways, imgPicker.title = [NSString stringWithString:@"My Name"]; imgPicker.navigationItem.title = [NSString stringWithString:@"My Name"]; But it still gives me the default title called "Photo Albums".Can anyone please tell me how to do it?.... Thanks.... 回答1: I found the way to do it. When you set your UIImagePickerController delegate to self and

How do I reduce Image quality/size in iPhone objective-c?

断了今生、忘了曾经 提交于 2019-11-28 07:41:04
I have an app that lets the user take a picture with his/her iPhone and use it as a background image for the app. I use UIImagePickerController to let the user take a picture and set the background UIImageView image to the returned UIImage object. IBOutlet UIImageView *backgroundView; -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { backgroundView.image = image; [self dismissModalViewControllerAnimated:YES]; } This all works fine. How can I reduce the size of the UIImage to 480x320 so my app can be

how to change the UIImagePickerController crop frame

∥☆過路亽.° 提交于 2019-11-28 06:49:39
when opening working with an UIImagePickerController and setting allowsImageEditing = YES; there is a default cropping frame that is 320x320. In my case, I would like to setup that cropping frame to 320x240 for images that are landscape, and 240x320 for images that are portrait. However, I haven't been able to find a way to change that 320x320 frame that is used when editing /cropping a photo. Has any of you found a way to do it? Thanks! You have to implement it your self. The picker only performs 320x320 cropping. So instead set allowsImageEditing = NO; Now you will get the full image back.

UIImagePickerController: Detecting Camera button (shutter) pressed

我只是一个虾纸丫 提交于 2019-11-28 06:31:21
问题 I would like to call a method that takes an NSNotification immediately after the user presses the camera shutter (i.e when the "Preview" tab bar has the buttons "Retake" and "Use"). I can't use the didFinishPickingImage method because at this time the user has already pressed the "Use" button. I have already implemented this by cameraOverlayView property of UIImagePickerController(see comments), but I wonder whether there are quicker ways of 'observing' this action. Any ideas? 回答1: To learn

iPad iOS7 - UIImagePickerController in UIPopoverController has wrong preview image

拥有回忆 提交于 2019-11-28 06:20:18
I am using an UIImagePickerController within an UIPopoverController which is working perfectly with iOS6. With iOS 7 the "preview" image which is shown to capture the image is rotated, but if I take a picture it is saved correctly. This is how I get my picker: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.mediaTypes = [NSArray arrayWithObjects: (NSString *) kUTTypeImage, nil]; imagePicker.allowsEditing = NO; And add it to a popover controller: self