added in version 22.1.0
belongs to Maven artifact


public abstract class RoundedBitmapDrawable
extends Drawable


A Drawable that wraps a bitmap and can be drawn with rounded corners. You can create a RoundedBitmapDrawable from a file path, an input stream, or from a Bitmap object.

Also see the Bitmap class, which handles the management and transformation of raw bitmap graphics, and should be used when drawing to a Canvas.


Public methods

void draw(Canvas canvas)
int getAlpha()
final Bitmap getBitmap()

Returns the bitmap used by this drawable to render.

ColorFilter getColorFilter()
float getCornerRadius()
int getGravity()

Get the gravity used to position/stretch the bitmap within its bounds.

int getIntrinsicHeight()
int getIntrinsicWidth()
int getOpacity()
final Paint getPaint()

Returns the paint used to render this drawable.

boolean hasAntiAlias()

Indicates whether anti-aliasing is enabled for this drawable.

boolean hasMipMap()

Indicates whether the mipmap hint is enabled on this drawable's bitmap.

boolean isCircular()
void setAlpha(int alpha)
void setAntiAlias(boolean aa)

Enables or disables anti-aliasing for this drawable.

void setCircular(boolean circular)

Sets the image shape to circular.

void setColorFilter(ColorFilter cf)
void setCornerRadius(float cornerRadius)

Sets the corner radius to be applied when drawing the bitmap.

void setDither(boolean dither)
void setFilterBitmap(boolean filter)
void setGravity(int gravity)

Set the gravity used to position/stretch the bitmap within its bounds.