2012-04-10 143 views

回答

2

试试下面的代码可能会帮助

Bitmap bitmap = Bitmap.createBitmap(mSurfaceView.getWidth(), mSurfaceView.getHeight(), Bitmap.Config.ARGB_8888); 
mSurfaceView.draw(new Canvas(bitmap)); 
try { 
    OutputStream out = new BufferedOutputStream(new FileOutputStream(saved.png)); 
    bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); 
} catch (IOException e) { 
    Log.w(TAG, e); 
}