Canvas : http://developer.android.com/reference/android/graphics/Canvas.html

BitmapDrawable : http://developer.android.com/reference/android/graphics/drawable/BitmapDrawable.html

 

Bitmap to Drawable

BitmapDrawable bitmapDrawable = (BitmapDrawable)bitmap;

Drawable drawable = (Drawable)bitmapDrawable;



Bitmap bitmap = new Bitmap (...);

Drawable drawable = new BitmapDrawable(bitmap);


Drawable to Bitmap

 

Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
d.setBounds(0, 0, w, h);
d.draw(canvas);


profile