推荐;
http://blog.youkuaiyun.com/chenshijun0101/article/details/38022789
public static Bitmap getNewBitmap(View v){ v.clearFocus(); v.setPressed(false); boolean willNotCache=v.willNotCacheDrawing(); v.setWillNotCacheDrawing(false); int color=v.getDrawingCacheBackgroundColor(); v.setDrawingCacheBackgroundColor(0); if(color!=0){ v.destroyDrawingCache(); } v.buildDrawingCache(); Bitmap cacheBitmap=v.getDrawingCache(); if(cacheBitmap==null){ return null; } Bitmap bitmap=Bitmap.createBitmap(cacheBitmap); v.destroyDrawingCache(); v.setWillNotCacheDrawing(willNotCache); v.setDrawingCacheBackgroundColor(color); return bitmap; }