方法1 使用Drawing Cache
直接上代码吧
View view = findViewById(R.id.testview);
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
view.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH);
//设置背景色
view.setDrawingCacheBackgroundColor(Color.WHITE);
//从Drawing Cache里取得图像内容
Bitmap bitmap <