3

私は Android の初心者で、ここでは新しいです。

Bitmap は画像をピクセルごとに保存し、圧縮を行わないことを知っています。

Drawable は Bitmap と同じですか?
または
同じ画像ファイルの場合、Drawable はビットマップよりも少ないメモリを使用しますか?</p>

ご回答ありがとうございます。

4

1 に答える 1

8

A bitmap is a Drawable. A Drawable is not necessarily a bitmap. Like all thumbs are fingers but not all fingers are thumbs.

The API dictates:

Though usually not visible to the application, Drawables may take a variety of forms:

  • Bitmap: the simplest Drawable, a PNG or JPEG image.
  • Nine Patch: an extension to the PNG format allows it to specify information about how to stretch it and place things inside of it.
  • Shape: contains simple drawing commands instead of a raw bitmap, allowing it to resize better in some cases.
  • Layers: a compound drawable, which draws multiple underlying drawables on top of each other.
  • States: a compound drawable that selects one of a set of drawables based on its state.
  • Levels: a compound drawable that selects one of a set of drawables based on its level.
  • Scale: a compound drawable with a single child drawable, whose overall size is modified based on the current level.
于 2012-08-24T10:07:12.137 に答える