I have been programming an android game for some time and I wonder if there is a difference between
a Bitmap
and a BitmapDrawable
.
Any answers should include any differences between the RAM, loading speed, etc.
I have been programming an android game for some time and I wonder if there is a difference between
a Bitmap
and a BitmapDrawable
.
Any answers should include any differences between the RAM, loading speed, etc.
Bitmap is faster to draw and usually good for background images. There is a significant change to FPS depending on if you draw a bitmap or drawable. Bitmaps are faster to move.Low usage of RAM
You can use Bitmap drawable if you need to do the things like scaling, moving and other kinds of manipulations of the image. Not as fast but there's no other option if you want to do any of those things just mentioned. There is a high usage of RAM in this case.
Side Note : A Drawable that wraps a bitmap and can be tiled, stretched, or aligned. You can create a Bitmap Drawable from a file path, an input stream, through XML inflation, or from a Bitmap object.
Bitmap is something that only represents an image or graphic. But on the other hand, BitmapDrawable is something that can be drawn like vector, layout,image etc.