Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone custom camera overlay (plus image processing) : how-to [duplicate]

Possible Duplicate:
How do you create a custom camera view, instead of UIImagePickerViewController?

Many image sharing apps available today from the App Store use a custom camera instead of the standard camera picker provided by Apple.

Does anyone know any tutorials or tips for creating a custom camera?

like image 555
Fred Collins Avatar asked Nov 10 '11 00:11

Fred Collins


People also ask

How do you copy the subject of a picture on iPhone?

Step 1: Open a suitable image in the Photos app on your iPhone. Step 2: Touch and briefly hold the subject of the photo until a glowing outline appears. Step 3: Begin moving your finger without lifting it. You should see a copy of the subject being dragged out of the photo with your finger.


1 Answers

Yes, create a UIImagePickerController from code, adjust its properties, add an overlay onto it, and with you controller, control whatever you want on that overlay : custom controls, overlaying images, etc...

That gives something like this :

self.picker = [[UIImagePickerController alloc] init];
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
self.picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
self.picker.showsCameraControls = NO;
self.picker.navigationBarHidden = YES;
self.picker.toolbarHidden = YES;
self.picker.wantsFullScreenLayout = YES;

// Insert the overlay
self.overlay = [[OverlayViewController alloc] initWithNibName:@"Overlay" bundle:nil];
self.overlay.pickerReference = self.picker;
self.picker.cameraOverlayView = self.overlay.view;
self.picker.delegate = self.overlay;

[self presentModalViewController:self.picker animated:NO];

OverlayViewController is the controller that you must write to control everything you add onto the overlay.

pickerReference is a property you can keep to send orders to the camera. For example, you could call the following from an IBAction coming from a UIButton placed onto the overlay :

[self.pickerReference takePicture];
like image 137
Oliver Avatar answered Nov 01 '22 19:11

Oliver