Android 中 Bitmap 和 Drawable 相互转换简单的方法

一、Drawable 转换成 Bitmap

Resources res = getResources();
Bitmap  bmp = BitmapFactory.decodeResource(res, R.drawable.ic_drawable);

二、Bitmap 转换成 Drawable

Drawable drawable = new BitmapDrawable(bmp);

猜你喜欢

转载自blog.csdn.net/qq_41979349/article/details/82560505