*

Image

BitmapとDrawableの変換

Bitmap(どう描くか) Drawable(何を描くか)

//Resource → Bitmap
BitmapFactory.decodeResource(getResources(), R.drawable.image)

//Resource → Drawable
getResources().getDrawable(R.drawable.image)

//Drawable   → Bitmap
((BitmapDrawable)drawable).getBitmap()

//Bitmap →Drawable
new BitmapDrawable(bitmap)