4

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.

LoveFortyDown
  • 1,011
  • 2
  • 17
  • 37
shizzle31
  • 93
  • 7

2 Answers2

9

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.

CopsOnRoad
  • 237,138
  • 77
  • 654
  • 440
Umer Waqas
  • 1,794
  • 1
  • 12
  • 15
  • If this answer is acceptable to you mark it as accept. – Umer Waqas Dec 31 '14 at 12:13
  • I'm a litte bit confused you say Bitmaps are faster to move but when i want to move it i shoud take a Drawable.. Do you mean it is dependent how many objects i want to draw or reather to move? What shoud now i take for moving objects(max. 25)? – shizzle31 Dec 31 '14 at 12:24
0

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.

Bhawna Raheja
  • 619
  • 4
  • 11