Is it possible to access images inside the folders in albums in iPad's library through UIImagePickerController
Thanks,
Christy
Use this instead:
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum
Yes!
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
here's the code......just create a button...n get the selected image from picker any where u want(modal or an view)
u can also access camera pics by using
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
-(IBAction) getPhoto:(id) sender {
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
if((UIButton *) sender == choosePhotoBtn) {
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
}
[self presentModalViewController:picker animated:YES];
}
Related
When I upgraded to iOS7, my app is showing an empty view controller when I access the photo Library from the application. It was working with older frameworks.
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
self.imagePicker = imagePickerController;
//self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:self.imagePicker animated:YES completion:nil];
Please apply direct this code
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.delegate = self;
[self presentViewController:imagePickerController animated:YES completion:nil];
when this code run then "application" Would like to access your photos message come when you click on OK then all images will be displayed
Thanks.
after taking a picture it is displying Retake,Preview and Use button.I need to change Use button as Save button.Is it possible?.
UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];
All
I have create UIImagePickerController with delegate and picking images from PhotoLibrary.
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
[self presentModalViewController:imagePicker animated:YES];
And when application reach to Editing view of UIImagePickerController i set one Overlay view and create two buttons for it.
Cancel and Choose
On Cancel Button click
[imagePicker popToViewController:[currentViewController.viewControllers objectAtIndex:1] animated:YES];
this cod work fine..
But choose Button does not working,
if i set code like here,
[self imagePickerController:imagePicker didFinishPickingMediaWithInfo:[imagePicker mediaTypes]];
than it returns NULL value of info dictionary.
Is that any other way to set overlay view on Editing ImagePicker ?
Regards,
try this code
CustomOverlayView *CustomOverlayView = [[CustomOverlayView alloc] initWithFrame:CGRectZero];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.allowsEditing = NO;
imagePickerController.delegate = self;
imagePickerController.showsCameraControls = YES;
[imagePickerController.view addSubview:CustomOverlayView];
[self presentModalViewController:imagePickerController animated:YES];
}
I am trying to do this .I know it very simple question .
Take Video: Take Picture: Choose from Library: Everything I find has separate buttons. Kinda like in the facebook app when you click on the camera button you get this picture.
I think people will me as soon as possible
Thanks in advance
To take Picture, video and select an image from photo library, UIImagePickerController will help you.
Ref: UIImagePickerController
To take picture and video, UIImagePickerControllerCameraCaptureMode has to be set properly.
Also the sourceType needs to be set as we required. See UIImagePickerControllerSourceType.
I guess these summary will help you. See the reference for more details.
If u want to browse thru ur photo library,
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];
If u want to take new photo,
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker. cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
[picker release];
If u want to take new video,
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker. cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
[picker release];
I can't believe this wasn't wrapped up in a little class. So I made one
https://github.com/fulldecent/FDTake
Example there shows taking a picture and choosing a photo from library.
Hi all I am implementing the following code to take a photo through my application
[[[UIApplication sharedApplication] keyWindow] setRootViewController:picker];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:NO];
Can anyone tel me How I can go to the photo gallery after the user takes the photo and not return to the application.
i think you might want to try this
How to open camera while I click the UIButton in iPhone?
or i really didn't get the question
Edit:
Well you can use the same code with UIImagePickerControllerSourcePhotoLibrary after taking the pic from camera. I mean call this Function with UIImagePickerControllerSourcePhotoLibrary then it will take you to photo Library and then back again to your application.
UIImagePickerControllerSourcePhotoLibrary
If you want to shoot a picure use this code -
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
picker.allowsImageEditing = YES;
[[self navigationController] presentModalViewController:picker animated:YES];
If you want to go to photo gallery and wants to select a photo from there use this code -
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
picker.allowsImageEditing = YES;
[[self navigationController] presentModalViewController:picker animated:YES];
Notice the difference between the picker's sourceType