Bitmap to Drawable:
Drawable drawable = new BitmapDrawable(bitmap);
Drawable to Bitmap:
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
但是在互相转换的时候尺寸可能会发生变化,可以采用Drawable d = new BitmapDrawable(getResources(),viewBitmap)来解决。
Bitmap to Drawable:
Drawable drawable = new BitmapDrawable(bitmap);
Drawable to Bitmap:
Bitmap bitmap = ((BitmapDrawable)drawable).getBitmap();
但是在互相转换的时候尺寸可能会发生变化,可以采用Drawable d = new BitmapDrawable(getResources(),viewBitmap)来解决。