Capture screen of GLSurfaceView to bitmap

SurfaceView and GLSurfaceView punch holes in their windows to allow their surfaces to be displayed. In other words, they have transparent areas. So you cannot capture an image by calling GLSurfaceView.getDrawingCache(). If you want to get an image from GLSurfaceView, you should invoke gl.glReadPixels() in GLSurfaceView.onDrawFrame(). I patched createBitmapFromGLSurface method and call it in onDrawFrame(). … Read more

tech