Welcome to the iMore Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 1 of 1
  1. Thread AuthorThread Author   #1  
    iSkythe's Avatar
    iPhone Beginner

    87 Posts

    Default 3.1 takePicture method

    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:

    -(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.

Posting Permissions