'Drawable'에 해당되는 글 1건

  1. 2013.01.21 [Android] convert drawable to bitmap

FROM drawable TO bitmap :

Drawable d = ImagesArrayList.get(0); 
Bitmap bitmap = ((BitmapDrawable)d).getBitmap();

 

FROM resource id of drawable TO bitmap:

Bitmap b1 = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_resource);

 

Reference:

http://stackoverflow.com/questions/3035692/how-to-convert-a-drawable-to-a-bitmap

 

 

 

 

Posted by Jyui