2

Possible Duplicate:
Overlay images onto Camera preview SurfaceView

Hi I want to create a custom camera preview widget and display current time on preview. how to add text on preview and Record Video. Please give me some idea?

Community
  • 1
  • 1
Ronit
  • 311
  • 1
  • 2
  • 16

1 Answers1

2

You could add your SurfaceView ( the one showing the Video) in a RelativeLayout. A RelativeLayout allows you to place the Views in relation to each other. For example you can define that View A is always above View and on the right side of the parent. Since this layout allows you place Views in relation to each other you can also place Views on top of each other. So you can place a SurfaceView in this Layout which fills the whole RelativeLayout and then place a TextView also in this Layout which always in the parents top left. The TextView will then overlay the SurfaceView since it has no relation to the SurfaceView.

Till Klocke
  • 338
  • 2
  • 8
  • When I Record Video using Camera, I can see TextView. But After Recording, When I play Video in other app, I don't See TextView. – Ronit Dec 15 '12 at 07:10
  • Thats because the TextView is not embedded in the Video itself. It is just an overlay over the preview. Embedding graphical objects into the video stream is far more complex. – Till Klocke Dec 17 '12 at 07:21