Android Camera Surface View

前端 未结 2 928
感情败类
感情败类 2020-12-05 05:38

I am trying to create a surface view for a camera so it renders on the surface whenever is in the view of the camera. At the moment all I can see on my camera view is a blac

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 06:13

    Make shure you added the permission :

    Also these window properties:

    getWindow().setFormat(PixelFormat.TRANSLUCENT);
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
                     WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    

    Post some code if that doesn't work in order to help you

提交回复
热议问题