I'm trying to get screenshot of GLSurfaceView sample with the following code in CubeRenderer's drawFrame() method:
Using java Syntax Highlighting
- b = Bitmap.createBitmap(320, 480, Bitmap.Config.ARGB_8888);
- c = new Canvas(b);
- GLSurfaceViewActivity.mGLSurfaceView.draw(c);
- CubeRenderer.SavePNG(b, "__screen00.png");/**/
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
SavePNG() code:
Using java Syntax Highlighting
- public static void SavePNG(Bitmap bmp, String name)
- {
- try
- {
- FileOutputStream fos = new FileOutputStream("/sdcard/" + name);
- bmp.compress(CompressFormat.PNG, 100, fos);
- try
- {
- fos.flush();
- }
- catch(IOException e)
- {
- e.printStackTrace();
- }
- try
- {
- fos.close();
- }
- catch(IOException e)
- {
- e.printStackTrace();
- }
- }
- catch(FileNotFoundException e)
- {
- e.printStackTrace();
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Resulting image in __screen00.png is entire white. SDK version is 1.1_r1.
Can't imagine what's the essence of the problem(( Any ideas?

