Hide camera preview but still receive preview callbacks

﹥>﹥吖頭↗ 提交于 2019-12-01 21:35:49

A solution is to even though set the Preview Size to be as the actual screen, in the onMeasure of the Preview SurfaceView make it smaller, that works for me:

@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
{  
   this.setMeasuredDimension(2, 2);  
}

Create a simple View with a black background color. Position the view at the same position as the camera's SurfaceView. The camera's preview will be effectively hidden.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!