您的位置:首页 > 移动开发 > Android开发

Android Bitmap 与 Drawable之间的转换

2010-08-30 09:15 375 查看
转换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