Android Take Screenshot of Surface View Shows Black Screen

前端 未结 4 1662
花落未央
花落未央 2020-11-22 04:58

I am attempting to Take a Screenshot of my Game through code and Share it through an Intent. I able to do of those things, however the screenshot always appears black. Here

4条回答
  •  清酒与你
    2020-11-22 05:51

    This is because SurfaceView uses OpenGL thread for drawing and draws directly to a hardware buffer. You have to use glReadPixels (and probably a GLWrapper).

    See the thread: Android OpenGL Screenshot

提交回复
热议问题