uiimagepickercontroller

Use the UIImagePickerController on a iphone simulator

纵饮孤独 提交于 2019-12-06 01:45:40
问题 I have the method, that take photos from gallery or from the camera -(IBAction) getPhoto:(id) sender { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if((UIButton *) sender == choosePhotoBtn) { picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera; } [self presentModalViewController:picker animated:YES]; } But when i run it on the simulator, code doesnt

camera overlay picture

久未见 提交于 2019-12-05 23:05:56
问题 edit 3 Good news and bad news. The good news is that in the Connections Inspector by disconnecting the overlay UIToolbar and connecting the UIImageview, I see theKing , but then -- the bad news -- I do not see the UIToolbar, which I also need. So the question now is, how can the user get back to the calling VC when s/he is finished here? How can both the toolbar and the image be part of the the overlay, or can the "go back button" toolbar be on the non-overlay view, or something? Or how can I

How to use image picker in iPad?

只谈情不闲聊 提交于 2019-12-05 22:48:59
I know how to use image picker in iPhone , although know need to use new class UIPopoverController in iPad, but still can not figure out one way to use image pickr in iPad, any one has the same problem ? thanks UIImagePickerController is just a view controller. If you know how to use a UIPopoverController to present a view controller, then it's just the same way. UIImagePickerController* imagePicker = ... UIPopoverController* popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker]; [imagePicker release]; [popover presentPopoverFromRect:...]; 来源: https://stackoverflow

Push a viewController from the UIImagePickerController camera view

耗尽温柔 提交于 2019-12-05 21:35:11
问题 I'm developing a messaging app (something like WhatsApp), users can send text and image messages to one another. when user wants to send an image, he can choose one from the camera roll or he can take one with the camera. This is how I present the UIImagePickerController for both cases: - (void)handleTakePhoto { UIImagePickerController *ipc = [[UIImagePickerController alloc] init]; ipc.delegate = self; ipc.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentModalViewController

Cannot change cameraFlashMode for UIImagePickerController iphone 4 custom cameraOverlayView

纵饮孤独 提交于 2019-12-05 20:36:49
Question : Why imagePickerController.cameraFlashMode always returns 0 on iphone 4 and returns correct values with iphone 5 ? I init my UIImagePickerController and set the cameraFlashMode to UIImagePickerControllerCameraFlashModeOn: imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; imagePickerController.mediaTypes = [NSArray arrayWithObject:@"public.image"]; imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto; imagePickerController.showsCameraControls = NO;

Cropping an Image to the shape of an Overlay - iOS

别说谁变了你拦得住时间么 提交于 2019-12-05 19:39:47
问题 I'm adding the overlay using pickerController's view and the uinavigationcontrollerdelegate as below. -(void)navigationController:(UINavigationController *)navigationController didShowViewController: (UIViewController *)viewController animated:(BOOL)animated{ if ([navigationController.viewControllers count] == 3) { CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height; UIView *plCropOverlay = [[[viewController.view.subviews objectAtIndex:1]subviews] objectAtIndex:0]; plCropOverlay

UIImagePickerController is not presenting correctly in iOS 8

大憨熊 提交于 2019-12-05 18:23:42
I'd like to present an UIImagePickerController with the following code: self.pickerController = [[UIImagePickerController alloc] init]; self.pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.pickerController.delegate = self; [self presentViewController:self.pickerController animated:YES completion:nil]; It's working fine for iOS 7 and below, but in iOS 8 I got the following glitch: While transitioning to the image picker controller (vertical cover animation), the background colour of the picker controller is invisible, revealing the presenting view controller

IOS UIImagePicker with mp4 format

你。 提交于 2019-12-05 18:20:47
Is it possible to save video and add it to custom ALAsset, captured from UIImagePicker in mp4 format? Or I have to save it in .mov and make compression by AVAssetExportSession? Yes, you can compress video using AVAssetExportSession . Here you can specify video type, quality and output url for compress video. See below methods: - (void) saveVideoToLocal:(NSURL *)videoURL { @try { NSArray *documentsDirectory = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docPath = [documentsDirectory objectAtIndex:0]; NSString *videoName = [NSString stringWithFormat:

iOS 7 UIImagePickerController navigationbar overlap

旧城冷巷雨未停 提交于 2019-12-05 18:04:27
I ran into a problem accessing photo library in iOS7 (iOS6 is OK). It seems navigation bar overlaps the photo album view, I tried to set picker.edgesForExtendedLayout = UIRectEdgeNone; but it doesn't work. UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) { picker.edgesForExtendedLayout = UIRectEdgeNone; } [self presentViewController:picker animated:YES completion:nil]; Look at my screenshot user2192708 This works for

Objective c - ios : How to pick video from Camera Roll?

夙愿已清 提交于 2019-12-05 17:26:28
问题 I try this : UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; videoPicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4]; videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh; [self presentViewController