[Android]Bitmap, Drawable之间的変換
2017-07-06 本文已影响0人
粥粥兄
Resource → Bitmap
BitmapFactory.decodeResource(getResources(), R.drawable.icon)
Resource → Drawable
getResources().getDrawable(R.drawable.icon)
Drawable → Bitmap
((BitmapDrawable) drawable).getBitmap()
Bitmap → Drawable
newBitmapDrawable(getResources,bitmap)