标签:class blog code java http 2014
/** * Canvas清屏的操作 * * 参考资料: http://blog.csdn.net/lfdfhl/article/details/9076001 * */ private void cleanCanvas() { mCanvas = mSurfaceHolder.lockCanvas(); if (mCanvas != null) { Paint paint = new Paint(); // 以下三行为清屏的核心代码 paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR)); mCanvas.drawPaint(paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC)); // 以上三行为清屏的核心代码 // 在清屏后再执行drawXXX()操作,比如: mCanvas.drawBitmap(mBitmap, lastX, 40, mPaint); } }
标签:class blog code java http 2014
原文地址:http://blog.csdn.net/lfdfhl/article/details/29558239