Example usage for Java android.graphics.drawable BitmapDrawable fields, constructors, methods, implement or subclass
The text is from its open source code.
BitmapDrawable(Resources res) Create an empty drawable, setting initial target density based on the display metrics of the resources. | |
BitmapDrawable(Bitmap bitmap) Create drawable from a bitmap, not dealing with density. | |
BitmapDrawable(String filepath) Create a drawable by opening a given file path and decoding the bitmap. | |
BitmapDrawable(java.io.InputStream is) Create a drawable by decoding a bitmap from the given input stream. | |
BitmapDrawable(Resources res, Bitmap bitmap) Create drawable from a bitmap, setting initial target density based on the display metrics of the resources. | |
BitmapDrawable(Resources res, String filepath) Create a drawable by opening a given file path and decoding the bitmap. | |
BitmapDrawable(Resources res, java.io.InputStream is) Create a drawable by decoding a bitmap from the given input stream. | |
BitmapDrawable(BitmapState state, Resources res) | |
BitmapDrawable() Create an empty drawable, not dealing with density. |
void | draw(Canvas canvas) |
Bitmap | getBitmap() Returns the bitmap used by this drawable to render. |
Rect | getBounds() Return the drawable's bounds Rect. |
ConstantState | getConstantState() |
int | getIntrinsicHeight() |
int | getIntrinsicWidth() |
Paint | getPaint() Returns the paint used to render this drawable. |
Drawable | mutate() A mutable BitmapDrawable still shares its Bitmap with any other Drawable that comes from the same resource. |
void | setAlpha(int alpha) |
void | setAntiAlias(boolean aa) Enables or disables anti-aliasing for this drawable. |
void | setBounds(int left, int top, int right, int bottom) Specify a bounding rectangle for the Drawable. |
void | setBounds(@NonNull Rect bounds) Specify a bounding rectangle for the Drawable. |
void | setCallback(@Nullable Callback cb) Bind a Callback object to this Drawable. |
void | setColorFilter(ColorFilter colorFilter) |
void | setDither(boolean dither) |
void | setFilterBitmap(boolean filter) |
void | setGravity(int gravity) Set the gravity used to position/stretch the bitmap within its bounds. |
void | setTargetDensity(Canvas canvas) Set the density scale at which this drawable will be rendered. |
void | setTargetDensity(DisplayMetrics metrics) Set the density scale at which this drawable will be rendered. |
void | setTargetDensity(int density) Set the density at which this drawable will be rendered. |
void | setTileModeX(Shader.TileMode mode) Sets the repeat behavior of this drawable on the X axis. |
void | setTileModeXY(Shader.TileMode xmode, Shader.TileMode ymode) Sets the repeat behavior of this drawable on both axis. |
void | setTileModeY(Shader.TileMode mode) Sets the repeat behavior of this drawable on the Y axis. |