2012-04-21 54 views
0

我尝试使用下面的代码来渲染GLSurfaceView为JPEG:渲染的Android的OpenGL ES 1.0 SurfaceView为JPEG

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(); 

我的完整的场景后执行此代码已经被渲染到surfaceview 。图像正在创建,但它们都是黑色的。有任何想法吗?

回答