Drawable graphical objects, you can reprint images in a common format, which may be (bitmaps) bitmapdrawable, or shapedrawable (graphics), or many other picture formats GIF,PNG,JEPG
Two. Bitmap is a bitmap for image processing
Three. Canvas, which is the target area for painting, is used to manage bitmp or path paths
Here's how to convert drawable into bitmap.
I know there are two methods (two methods who are good and who are bad, depends on the situation)
(1) A common way is to create a bitmap, and then use the canvas to bind the bitmap, drawable to bitmap (this method for the Drawable object at this time is not bitmap image)
Bitmap bitmap=bitmap.createbitmap (size, size, Bitmap.Config.ARGB_8888);//Create a bitmap with a size wide size height canvas canvas=new Canvas (bitmap);//Bind the canvas to the bitmap and prepare for the next drawable painting Drawable.setbounds (0,0,size,size);// Drawable set the same size as the bitmap drawable.draw (canvas);//Will drawable through the canvas to bitmap up
(2) Another way is to get bitmap directly (bitmapdrawable)
Bitmap Icon=bitmapfactory.decoderesource (Context.getresources (), R.drawable.icon_resource)//drawable in Icon_ object Resource image conversion to bitmap file icon
Or
bitmapdrawable BD = (bitmapdrawable) drawable;//first converted to bitdrawable bitmap = Bd.getbitmap ();//again via Getbitmap () Get to Bitmap
The first to get here, in the future continue to add after depth!
Android in the design interface Drawable,canvas, and bitmap