方法一:
customView.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap(customView.getDrawingCache());
方法二:
Bitmap bitmap = Bitmap.createBitmap(customView.getWidth(), customView.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); customView.draw(canvas);
原文:http://www.cnblogs.com/rfheh/p/4164817.html