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);

你可能感兴趣的:(android)