I'm trying to render a GLSurfaceView to a JPEG using the following code:
FileOutputStream image = FileIO.getInstance().writeFile("racesow/test" + this.frameNum +" .jpg"); // creates an ouputstream in external storage directory
Bitmap bitmap = Bitmap.createBitmap(640, 480, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
this.game.glView.draw(canvas); // glView is the GLSurfaceView
bitmap.compress(Bitmap.CompressFormat.JPEG, 85, image);
image.flush();
image.close();
I'm executing this code after the complete scene has been rendered to the surfaceview. The images are being created but they're all black. Any ideas?