How to add a rectangular overlay in a camera application?

前端 未结 2 728
悲哀的现实
悲哀的现实 2021-01-31 06:44

How do I add a rectangular overlay (which should be more like a rectangular frame) in the camera preview? My application consists of a button that opens the camera upon clicking

2条回答
  •  旧巷少年郎
    2021-01-31 07:06

    You have to create your own Preview by extending the SurfaceView class.

    See below link which helps you.

    Custom camera android

    Take FrameLayout with SurfaceView as child.and customise as per your needs

提交回复
热议问题