uiimagepickercontroller

How to show all camera controls with/for UIImagePickerController?

寵の児 提交于 2019-12-02 09:42:28
问题 I have trouble showing the camera controls when using UIImagePickerController. Specifically, I need to be able to select between slo-mo, video, photo, square and pano. The essential part of code I use is: UIImagePickerController *pc = [[UIImagePickerController alloc] init]; [pc setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; pc.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil]; But this shows a picker controller with the ability to take a picture only

how to enable preview after selecting picture from library?

落花浮王杯 提交于 2019-12-02 09:27:44
I am trying to write an app which involves picking a picture from either camera or library. Once the picture is picked , I want to show the preview of the picture.It happens by default when camera is opted. Once the photo is clicked, it shows the user to choose or retake. But I want the same to be done when the picture is selected from the photo library also. Can this be done?? Ok thanks for the response. Here is what I did: Subclass UIImagePickerController . Upon picking an image, I am pushing another viewcontroller which is similiar to preview screen. This is similiar to facebook app and so

ModalViewController loading on top of another Modal

元气小坏坏 提交于 2019-12-02 08:45:35
There may be a better way to do this, and please direct me if there is. I'm creating an UIImagePickerController with an overlayView in viewDidAppear for 'choose from library', 'take photo', 'flash' 'camera source', etc. // Set up the camera imagePicker = [[UIImagePickerController alloc] imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate = self; imagePicker.cameraOverlayView = [self cameraOverlayView]; cameraOverlayView.backgroundColor = [UIColor clearColor]; imagePicker.showsCameraControls = NO; imagePicker.toolbarHidden = YES; imagePicker

How to receive bytes when video is recording

妖精的绣舞 提交于 2019-12-02 08:30:01
i am developing iphone video app,in that i want to get bytes occupied in disk when user is recording the video itself . - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info; this method is called after user is finished picking.is there any method UIImage *img = [UIImage imageNamed:@"sample.png"]; NSData *imgData = UIImageJPEGRepresentation(img, 0); NSLog(@"Size of Image(bytes):%d",[imgData length]); NSData *data = [info objectForKey: UIImagePickerControllerMediaMetadata]; 来源: https://stackoverflow.com/questions/22127288/how-to

Creating an image format with an unknown type is an error UIImagePickerController() , unexpectedly found nil

拈花ヽ惹草 提交于 2019-12-02 08:02:28
Swift Version 3 Xcode Version 8.3.3 (8E3004b) This question has been asked and answered before. Yet, I cannot find a way fix this error. "Creating an image format with an unknown type is an error" with UIImagePickerController When a new picture is selected from Photo Library, I get this error Generic Creating an image format with an unknown type is an error. I select the photo and when I tap choose, I get error in func takePhoto where I do this assignment self?.imgView.image = newImage fatal error: unexpectedly found nil while unwrapping an Optional value Printing description of newImage:

Open camera view upon app Startup (iOS6)

感情迁移 提交于 2019-12-02 07:58:42
问题 what im trying to do is to have the app open up with the camera as the first screen. It isn't working and i don't know what im missing. If anyone can fill me in that would be wonderful... Thanks. - (void)viewDidLoad { [super viewDidLoad]; UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; } else {

How do I reference the picture I just took in iOS?

戏子无情 提交于 2019-12-02 07:39:20
I'm writing an app that allows the user to take a picture and then shows it in an image view. I get that I need to write a line of code similar to the following: _imageView.image = picker.image; , but I'm not sure what I need to substitute for picker.image . That is what I currently have and it gives me an error. Basically, what I'm asking is how do I reference the picture that was just taken? Where does this picture go (in memory?) after you take it? How can I reference it later (like for displaying and saving and that sort of stuff)? I've already read the official Apple documentation and

Open camera view upon app Startup (iOS6)

流过昼夜 提交于 2019-12-02 07:28:24
what im trying to do is to have the app open up with the camera as the first screen. It isn't working and i don't know what im missing. If anyone can fill me in that would be wonderful... Thanks. - (void)viewDidLoad { [super viewDidLoad]; UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; } else { [imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; } } Try like that. Hope it helps

UIImagePickerController reloads view after its dismissed?

筅森魡賤 提交于 2019-12-02 06:35:52
I create the picker: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate = self; imagePicker.allowsEditing = NO; [self presentModalViewController:imagePicker animated:YES]; and I handle the didFinishPickingMediaWithInfo: - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; [picker release];} but this calls the viewDidLoad on self. This is not normal is it? Whats wrong?

UIImagePickerController in UIPopoverController - location not working

谁都会走 提交于 2019-12-02 06:08:41
In an iPad app I'm writing I have button in a static table cell that launches an image picker inside a popover. I want the popover's arrow to point at the button that launched the popover. Right now, when I tap the button it doesn't. It throws the popover on screen (with the working image picker) but the arrow either points to the top of the screen or kind of anywhere else (can't figure out if it's random or not--see below). The tableview that holds the static cell that contains the button has its scroll disabled but is located on a scroll view. Could that cause random arrow locations? Here is