Reputation: 211
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
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
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.
Upvotes: 3