转换Bitmap to Drawable

//pattern 1

BitmapDrawable bitmapDrawable = (BitmapDrawable)bitmap;  
Drawable drawable = (Drawable)bitmapDrawable;   
//pattern 2
Bitmap bitmap = new Bitmap (...);  
Drawable drawable = new BitmapDrawable(bitmap);

转换Drawable to Bitmap

Drawable d = ImagesList,get(0);

Bitmap bitmap = ((BitmapDrawable)d).getBitmap();

ps:临时用到的, 小总结下… …

相关文章:

  • 2021-11-30
  • 2022-01-20
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-28
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
相关资源
相似解决方案