ios open camera image from roll - ios

I´m creating an app that access to the Camera roll using ImagePickerController. The app has a buttom and when I tap on it the app should go to the last image saved on the roll. Using that code:
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated: YES];
the app open the thumbnails and I would like to open a specific image (full screen)
Is possible?

Image will open in full view only if you want to make edit to it.
Add this line to open in full view before presenting .
[picker setAllowsEditing:YES];
If you wish more function than you have two option.
Use your own custom control.
Add overlay view on UIImagePickerController
Refer this example to create your controls:
DLCImagePickerController
AGImagePickerController

Related

Default flash controls of camera app appears truncated

We are developing and iOS application and in one of the View Controllers UIImagePickerController is used to present the camera to the user. In the view controller there is a UIButton and in the event listener method we have the following code.
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
imagePicker.cameraFlashMode = UIImagePickerControllerCameraFlashModeOff;
[self presentViewController:imagePicker animated:YES completion:NULL];
Camera app is presented properly, but the flash control titles are appearing truncated (Auto is appearing as Au..., Off is appearing as ...) as shown in the screen shots. It would be great if someone can help out. I'm guessing it's some app configuration issue, as the same code works in a different project.
Thanks in advance.

How to access a saved photo inside simulator on IOS 7

I had drag and drop a photo inside the IOS simulator and then saved it inside Safari. This photo got saved in /Users/myuser/Library/Application Support/iPhone Simulator/7.1-64/Media/DCIM/100APPLE/IMG_0001.JPG.
When I run the app using UIImagePickerController I cannot see any photos, just the message: No Photos or Videos. You can sync photos and videos onto your iPhone using iTunes.
Is there anything different I have to do to access that photo ?
When in the simulator, go to safari, then search an image.
Long press that image and a popup will show. Choose Save Image. Now the image is saved in your saved photos album.
When in the app, open the ImagePicker like this :
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *) kUTTypeImage, nil];
[self presentViewController:picker animated:YES completion:NULL];
Be sure to include <MobileCoreServices/MobileCoreServices.h> for the mediaType (if you want photos only, without videos).
(if it's an iPad app it will be a little different, you will need to use UIPopoverController).
You should be able to see that image you saved.
Good Luck.

Image picker in selfie mode

I'm trying to find a way to open the image picker view direcly in "selfie" mode. (To take have the camera showing the user's face)
Does someone has a trick to do that ?
You can simply do this by setting two properties of UIImagePickerController like this -
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
[picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[picker setCameraDevice:UIImagePickerControllerCameraDeviceFront];
You need to set Camera Device to Front and need to set Source Type to Camera.

limit UIImagePicker Camera View to a small part of screen

I am developing an app which uses UIImagePicker to capture and save screen.
Following is the code to launch camera.
UIImagePickerController *imgPickController = [[UIImagePickerController alloc] init];
imgPickController.sourceType = UIImagePickerControllerSourceTypeCamera;
imgPickController.delegate =self;
imgPickController.allowsEditing=YES;
[self presentModalViewController:imgPickController animated:YES];
This launches the camera in the whole screen.
Is there any way to just show the camera-view inside another small subview on the app-screen?? Hope I am clear. Thanks.

iPad2 camera display not showing

I have an iPhone app that displays the camera using UIImagePicker to take a picture. I am porting it to iPad2 and when i want to display the camera (through a modalviewcontroller) i get the camera buttons but the display in the preview is just white. If i take the picture i can see it.
Does this happen to you?
I am experiencing the same problem. I moved the UIImagePicker code to my rootviewcontroller, and it worked. I could see what was actually through the viewfinder. It also worked via a popover in the existing viewcontroller (called next after the rootviewcontroller), but the resolution was poor when I displayed the photo. This is not satisfactory, but I guess I found a workaround if absolutely necessary.
Yesterday only i have tried this code to use camera to take pics. from my app and it worked on iphone after porting it.
I think you need to call takePicture method on the controller.
Just a guess.
if([UIImagePickerController isSourceTypeAvailable:sourceType])
{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = sourceType;
picker.delegate = self;
if(sourceType == UIImagePickerControllerSourceTypeCamera)
[picker takePicture];
[self presentModalViewController:picker animated:YES];
[picker release];
}

Resources