引用:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=40776 12楼
清屏可以用橡皮擦的画笔画一个屏幕大小的矩形就可以了
//这是定义橡皮擦画笔
Paint clearPaint = new Paint();
clearPaint.setAntiAlias(true);
clearPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
//清屏过程
mDrawingView.mCanvas.drawRect(0, 0, 800, 480, clearPaint);
Canvas canvas = mDrawingView.mSurfaceHolder.lockCanvas();
canvas.drawColor(Color.TRANSPARENT,Mode.CLEAR);
canvas.drawBitmap(mDrawingView.mBitmap, 0, 0, mDrawingView.mBitmapPaint);
mDrawingView.mSurfaceHolder.unlockCanvasAndPost(canvas);
(mDrawingView是我的SurfaceView)