转换Bitmap to Drawable
BitmapDrawable bitmapDrawable = (BitmapDrawable)bitmap;
Drawable drawable = (Drawable)bitmapDrawable;
Bitmap bitmap = new Bitmap (...);
Drawable drawable = new BitmapDrawable(bitmap);
转换Drawable to Bitmap
Drawable d = ImagesList.get(0);
Bitmap bitmap = ((BitmapDrawable)d).getBitmap();
本文介绍了如何在Android中实现Bitmap与Drawable之间的相互转换。包括从Bitmap创建Drawable的方法以及从Drawable提取Bitmap的过程。
2378

被折叠的 条评论
为什么被折叠?



