2015年1月20日火曜日

【android】 Drawable Bitmap変換

Resource → Bitmap

BitmapFactory.decodeResource(getResources(), R.drawable.icon)

Resource → Drawable

getResources().getDrawable(R.drawable.icon)

Drawable → Bitmap

((BitmapDrawable) drawable).getBitmap()

Bitmap → Drawable

new BitmapDrawable(bitmap)

0 件のコメント:

コメントを投稿