3.1 takePicture method

iSkythe

Well-known member
May 12, 2009
87
2
0
Visit site
One of the things I'd like my app to do is to take a simple picture using the camera and saving it to the camera roll, but by using the new APIs in 3.1

Here is my code so far:

Code:
-(IBAction)openPreview:(id)sender {

UIImagePickerController *preview = [[UIImagePickerController alloc] init];
     preview.sourceType = UIImagePickerControllerSourceTypeCamera;
    preview.showsCameraControls = NO;
overlayView.backgroundColor = [UIColor clearColor];
     preview.cameraOverlayView = overlayView;
     preview.cameraViewTransform = CGAffineTransformScale(preview.cameraViewTransform, 1.13f, 1.13f);
     [self presentModalViewController:preview animated:YES];
     [preview release];

}

How would I make it so when I click a button on the overlayView, it'll use the takePicture method and save it to the camera roll? Everytime I make an IBAction, I have to redeclare *preview, which doesn't seem to be working out.

Oh, and the overlayView is working perfectly, it's just the takePicture I need.
 

Trending Posts

Members online

Forum statistics

Threads
260,347
Messages
1,766,500
Members
441,237
Latest member
Tomwex73