Questions tagged [uiimagepickercontroller]

Questions related to the iOS UIImagePickerController class (and the associated UIImagePickerControllerDelegate protocol), which provides system-supplied user interfaces for taking pictures and movies on iOS devices, and for choosing saved images and movies.

The UIImagePickerController class manages customizable, system-supplied user interfaces for taking pictures and movies on supported devices, and for choosing saved images and movies for use in your app. An image picker controller manages user interactions and delivers the results of those interactions to a delegate object.

The role and appearance of an image picker controller depend on the source type you assign to it before you present it.

  • A sourceType of UIImagePickerControllerSourceTypeCamera provides a user interface for taking a new picture or movie (on devices that support media capture).
  • A sourceType of UIImagePickerControllerSourceTypePhotoLibrary or
    UIImagePickerControllerSourceTypeSavedPhotosAlbum provides a user
    interface for choosing among saved pictures and movies.

To use an image picker controller containing its default controls, perform these steps:

  1. Verify that the device is capable of picking content from the desired source. Do this calling the isSourceTypeAvailable: class method, providing a constant from the “UIImagePickerControllerSourceType” enum.
  2. Check which media types are available, for the source type you’re using, by calling the availableMediaTypesForSourceType: class method. This lets you distinguish between a camera that can be used for video recording and one that can be used only for still images.
  3. Tell the image picker controller to adjust the UI according to the media types you want to make available—still images, movies, or both—by setting the mediaTypes property.
  4. Present the user interface by calling the presentViewController:animated:completion: method of the currently active view controller, passing your configured image picker controller as the new view controller. On iPad, present the user interface using a popover. Doing so is valid only if the sourceType property of the image picker controller is set to UIImagePickerControllerSourceTypeCamera. To use a popover controller, use the methods described in “Presenting and Dismissing the Popover” in UIPopoverController Class Reference.
  5. When the user taps a button to pick a newly-captured or saved image or movie, or cancels the operation, dismiss the image picker using your delegate object. For newly-captured media, your delegate can then save it to the Camera Roll on the device. For previously-saved media, your delegate can then use the image data according to the purpose of your app.

    For details on these steps, refer to Apple's “Taking Pictures and Movies”.

4123 questions
1
vote
0 answers

UIImagePickerController finishing picking when the app goes to background on time when video still compressing

We got a problem with UIImagePickerController: in our application users can pick media with big size(for example 4k video). For media picking we use UIImagePickerController and everything worked well. But if the user moves the device to sleep, when…
1
vote
1 answer

UIImagePickerController takePicture method

Target: Taking pictures in silent mode while other GUI is running. OS: IOS 4.3 I doing a test, I want to take one image in silent mode when ViewDidLoad is execute: I do not want any camera gui what so ever... let me know what do you…
user552120
1
vote
2 answers

Accessing all photos in iphone photo library?

Is it possible to get all photos in an array or something from iPhone photo library ? UIImagePickerController allows to choose only one picture at a time.
Can
  • 536
  • 2
  • 7
  • 22
1
vote
3 answers

Creating Thumbnail of a Image in iPhone?

i am trying to create thumbnail of a image i am importing from photo library or camera using a UIImagePickerController using - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)selectedImage…
hemant
  • 1,771
  • 4
  • 31
  • 43
1
vote
0 answers

Modify image picker label from 'USE PHOTO' to 'CHOOSE'

I have an app that either capture or pick image from gallery, the problem is that the client wants to change the label in imagepicker from 'USE PHOTO' to 'CHOOSE' if UIImagePickerController.isSourceTypeAvailable(.camera) { let showCamera =…
JhayCo
  • 11
  • 1
  • 2
  • 6
1
vote
1 answer

iPhone: problems resizing image from UIImagePickerController

What I'm trying to achieve: At the moment, I have a UIImagePickerController set up to take a picture, and return it as a small-sized photo (about 300 x 500ish pixels). By default, the image obtained from the image picker is full resolution - i.e.…
Jordan Smith
  • 10,310
  • 7
  • 68
  • 114
1
vote
3 answers

presentModalViewController:animated not found

In the app I am trying to build, I am trying to use the UIImageController but am running into a bit of a problem. I am not doing this in the ViewController class... Here's the code: (IBAction) uploadBtn { ipc = [[UIImagePickerController alloc]…
Dan
  • 61
  • 1
  • 3
1
vote
1 answer

UIImagePickerController memory leak issue

In my application, I am using UIImagePickerController to take the photos, videos, choosing images from gallery and saving them in application document directory. If we launch camera and take picture/videos, app starts terminating without any crash…
1
vote
0 answers

Get image create time when photo selected from swift UIimagePickerController, PHAsset deprecated?

import Photos public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { if let image = info[UIImagePickerController.InfoKey.originalImage?] as?…
Daniel Patriarca
  • 361
  • 3
  • 20
1
vote
0 answers

how to use UIImagePickerController (base on cocos2d 1.00rc)

I am new to cocos2d. I use this sample code, but the screen just displays a blue Nav bar. Anyone can tell me how to use the UIImagePickerController? Thanks.
neal
  • 106
  • 3
1
vote
1 answer

UIImagePickerController hide square selection in allowsEditing

I would like to display a UIImagePickerController with the allowsEditing property set to true, since that gives you a nice view of the photo that you took with the ability to "Retake" or "Use Photo". However, I don't want the user to be able to crop…
unixb0y
  • 979
  • 1
  • 10
  • 39
1
vote
0 answers

Fill different iPhones screen when using camera view for augmented reality Xcode

I am working on an app which places labels of cities on top of the cameraView for augmented reality. When I open the camera I hide the controls and navigationBar and toolBar. I use the following code I found online to resize the camera view to…
1
vote
3 answers

UIImagePickerController and UINavigationControllerDelegate implementation

I am trying to pick an image from gallery using UIImagePickerController. If my view controller is not mentioning UINavigationControllerDelegate. I will be getting following error while trying to set UIImagePickerController delegate. But just…
Sreehari
  • 5,621
  • 2
  • 25
  • 59
1
vote
0 answers

How to have a choose image button with a preview of last taken image

I am building a camera app and would like to have the last taken photo show up as a button to choose a photo. How would I do that? Right now I am using UIImagePickerController to choose the image, and UIButton with just text to bring up the…
Mason
  • 33
  • 5
1
vote
1 answer

UIImagePickerController, application exit when clicking cancel button on right top of photo album screen on selecting a image

UIImagePickerController, application exit when clicking cancel button on right top of photo album screen on selecting a image. -(void) getImageAction:(id) sender { imagePickerController = [[UIImagePickerController alloc] init]; …
udhayaa
  • 11
  • 2