user688262
user688262

Reputation: 211

Camera as background view?

I would like to test around a bit with augmented reality. My first problem is how to get the picture that comes from the camera as background for my view? For what i want to do, i dont need to access the picture, i just need it as background. I found a few solutions how to take a picture with the camera, but nothing that gives me a picture that comes from the camera.

thanks,.

Upvotes: 0

Views: 1069

Answers (2)

Nicolas S
Nicolas S

Reputation: 5365

another way would be using UIImagePickerController . Create an instance, say picker and set: picker.showsCameraControls = NO . And finally set cameraOverlayView with your overlay: picker.cameraOverlayView = someViewController.view. Hope this helps.

Upvotes: 1

Paul Hunter
Paul Hunter

Reputation: 4463

I would use AVFoundation for that.

You need to set up an AVCaptureSession with an AVCaptureDevice and an AVCaptureDeviceInput. Finally - and this is what you're interested in - set up an AVCaptureVideoPreviewLayer.

Send the startRunning: message to your AVCaptureSession object, and you should be good to go.

Docs here: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/03_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW14

Upvotes: 3

Related Questions