Question

I run into following Problem: I'm currently displaying a CameraPreview on a SurfaceView using its SurfaceHolder as described here Camera Dev Guide. So its mentioned that I have to set the Type of my SurfaceHolder like this;

// deprecated setting, but required on Android versions prior to 3.0
 mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

unfortunatly after that setting mHolder.lockCanvas() will fail,so that I cannot draw anymore on that Canvas. Is there a possibility, to draw PreviewFrames as well as own Views on one single SurfaceView?

If Not, is it possible to render two SurfaceViews, so that the Camera will serve as a background and the second SurfaceView will render any of its Views 'on Top' of it? What is the best approach to get this running?

Was it helpful?

Solution

Yes i have alredy did this. What you can do is that you can create a relative layout then you can add your surface view to it with proper layout params. then you can add your other view on that same relative layout with proper layout params.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top