Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Take a picture in iOS without UIImagePicker and without preview it

Do you know any way / method to take a photo in iOS and saving it to camera Roll only with a simple button pressure without showing any preview?

I already know how to show the camera view but it show the preview of the image and the user need to click the take photo button to take the photo.

In few Words: the user click the button, the picture is taken, without previews nor double checks to take / save the photo.

I already found the takePicture method of UIIMagePickerController Class http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instm/UIImagePickerController/takePicture

like image 284
fntlnz Avatar asked Jan 06 '13 18:01

fntlnz


People also ask

Can you take a picture on iPhone without opening the Camera?

You can use the cool new jailbreak tweak on iOS 10 that will allow you to take pictures without having to launch the camera app. QuickShoot Pro iOS 10 jailbreak tweak will capture a photo with just the tap of a button.

How do you take a regular picture on iPhone?

Take a photo or videoTap the Shutter button, or press either volume button to take a photo. Tip: If you want to take a video while you're in Photo mode, touch and hold the Shutter button to record a QuickTake video (iPhone 11 and later).

How do I take a picture of a video on my iPhone without screenshot?

Just open the Camera Roll or Photos app on the device, find and play the video, then pause at the video frame which you like to grab and save as image file, finally press the home and sleep buttons simultaneously.


2 Answers

Set the showsCameraControls-Property to NO.

    poc = [[UIImagePickerController alloc] init];
    [poc setTitle:@"Take a photo."];
    [poc setDelegate:self];
    [poc setSourceType:UIImagePickerControllerSourceTypeCamera];
    poc.showsCameraControls = NO;

You also have to add your own Controls as a custom view on the top of poc.view. But that is very simple and you can add your own UI-style by that way.

You receive the image-data as usually within the imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:

To take the photo, you call

[poc takePicture];

from your custom button.

Hope, that works for you.

like image 61
Dominic Sander Avatar answered Sep 30 '22 12:09

Dominic Sander


Assuming you want a point-and-shoot method, you can create an AVSession and just call the UIImageWriteToSavedPhotosAlbum method. Here is a link that goes into that exact process: http://www.musicalgeometry.com/?p=1297

It's also worth noting that your users need to have given the app access to their camera roll or you may experience issues saving the images.

like image 41
propstm Avatar answered Sep 30 '22 12:09

propstm