Android 控件界面转成Bitmap

方法一:

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);
posted @ 2014-12-15 14:33  rfheh  阅读(382)  评论(0编辑  收藏  举报