문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top