# RoundedBitmapDrawable

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/drawable/RoundedBitmapDrawable.java+class:androidx.core.graphics.drawable.RoundedBitmapDrawable) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

<br />

```
abstract class RoundedBitmapDrawable : Drawable
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) ||
|   | ↳ | [androidx.core.graphics.drawable.RoundedBitmapDrawable](https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable) |

*** ** * ** ***

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 `https://developer.android.com/reference/android/graphics/Bitmap.html` object.

Also see the `https://developer.android.com/reference/android/graphics/Bitmap.html` class, which handles the management and transformation of raw bitmap graphics, and should be used when drawing to a `https://developer.android.com/reference/android/graphics/Canvas.html`.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#draw(android.graphics.Canvas)(canvas: https://developer.android.com/reference/android/graphics/Canvas.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getAlpha()()` |
| `https://developer.android.com/reference/android/graphics/Bitmap.html?` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getBitmap()()` Returns the bitmap used by this drawable to render. |
| `https://developer.android.com/reference/android/graphics/ColorFilter.html!` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getColorFilter()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getCornerRadius()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getGravity()()` Get the gravity used to position/stretch the bitmap within its bounds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getIntrinsicHeight()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getIntrinsicWidth()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getOpacity()()` **This function is deprecated.** |
| `https://developer.android.com/reference/android/graphics/Paint.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#getPaint()()` Returns the paint used to render this drawable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#hasAntiAlias()()` Indicates whether anti-aliasing is enabled for this drawable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#hasMipMap()()` Indicates whether the mipmap hint is enabled on this drawable's bitmap. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#isCircular()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setAlpha(int)(alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setAntiAlias(boolean)(aa: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enables or disables anti-aliasing for this drawable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setCircular(boolean)(circular: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets the image shape to circular. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setColorFilter(android.graphics.ColorFilter)(cf: https://developer.android.com/reference/android/graphics/ColorFilter.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setCornerRadius(float)(cornerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the corner radius to be applied when drawing the bitmap. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setDither(boolean)(dither: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` **This function is deprecated.** |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setFilterBitmap(boolean)(filter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setGravity(int)(gravity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the gravity used to position/stretch the bitmap within its bounds. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setMipMap(boolean)(mipMap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enables or disables the mipmap hint for this drawable's bitmap. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setTargetDensity(android.graphics.Canvas)(canvas: https://developer.android.com/reference/android/graphics/Canvas.html)` Set the density scale at which this drawable will be rendered. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setTargetDensity(int)(density: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Set the density at which this drawable will be rendered. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setTargetDensity(android.util.DisplayMetrics)(metrics: https://developer.android.com/reference/android/util/DisplayMetrics.html)` Set the density scale at which this drawable will be rendered. |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#onBoundsChange(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html)` |

### Inherited functions

From [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#applyTheme(android.content.res.Resources.Theme)(t: https://developer.android.com/reference/android/content/res/Resources.Theme.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#canApplyTheme()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#clearColorFilter()()` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromPath(java.lang.String)(pathName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, java.lang.String)(

res: https://developer.android.com/reference/android/content/res/Resources.html!,

value: https://developer.android.com/reference/android/util/TypedValue.html!,

is: https://developer.android.com/reference/java/io/InputStream.html!,

srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!

)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromStream(java.io.InputStream, java.lang.String)(is: https://developer.android.com/reference/java/io/InputStream.html!, srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser)(r: https://developer.android.com/reference/android/content/res/Resources.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)(

r: https://developer.android.com/reference/android/content/res/Resources.html!,

parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!,

attrs: https://developer.android.com/reference/android/util/AttributeSet.html!

)` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getBounds()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCallback()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getChangingConfigurations()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getConstantState()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCurrent()()` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getDirtyBounds()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getHotspotBounds(android.graphics.Rect)(outRect: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLayoutDirection()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLevel()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumHeight()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumWidth()()` `https://developer.android.com/reference/android/graphics/Insets.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOpticalInsets()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOutline(android.graphics.Outline)(outline: https://developer.android.com/reference/android/graphics/Outline.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getPadding(android.graphics.Rect)(padding: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getState()()` `https://developer.android.com/reference/android/graphics/Region.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getTransparentRegion()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#hasFocusStateSpecified()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)(r: https://developer.android.com/reference/android/content/res/Resources.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!, attrs: https://developer.android.com/reference/android/util/AttributeSet.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#invalidateSelf()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isAutoMirrored()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isFilterBitmap()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isProjected()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isStateful()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isVisible()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#jumpToCurrentState()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#mutate()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLayoutDirectionChanged(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLevelChange(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onStateChange(int[])(state: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#resolveOpacity(int, int)(op1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, op2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#scheduleSelf(java.lang.Runnable, long)(what: https://developer.android.com/reference/java/lang/Runnable.html!, when: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setAutoMirrored(boolean)(mirrored: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)(cb: https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setChangingConfigurations(int)(configs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspot(float, float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspotBounds(int, int, int, int)(left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLayoutDirection(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLevel(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setState(int[])(stateSet: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTint(int)(tintColor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintBlendMode(android.graphics.BlendMode)(blendMode: https://developer.android.com/reference/android/graphics/BlendMode.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintList(android.content.res.ColorStateList)(tint: https://developer.android.com/reference/android/content/res/ColorStateList.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintMode(android.graphics.PorterDuff.Mode)(tintMode: https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setVisible(boolean, boolean)(visible: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, restart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#unscheduleSelf(java.lang.Runnable)(what: https://developer.android.com/reference/java/lang/Runnable.html!)`

## Public functions

### draw

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun draw(canvas: Canvas): Unit
```

### getAlpha

```
fun getAlpha(): Int
```

### getBitmap

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun getBitmap(): Bitmap?
```

Returns the bitmap used by this drawable to render. May be null.

### getColorFilter

```
fun getColorFilter(): ColorFilter!
```

### getCornerRadius

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun getCornerRadius(): Float
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The corner radius applied when drawing the bitmap. |

### getGravity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun getGravity(): Int
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the gravity applied to the bitmap |

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/Gravity.html` |   |

### getIntrinsicHeight

```
fun getIntrinsicHeight(): Int
```

### getIntrinsicWidth

```
fun getIntrinsicWidth(): Int
```

### getOpacity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun getOpacity(): Int
```

> [!CAUTION]
> **This function is deprecated.**   

### getPaint

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun getPaint(): Paint
```

Returns the paint used to render this drawable.

### hasAntiAlias

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun hasAntiAlias(): Boolean
```

Indicates whether anti-aliasing is enabled for this drawable.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if anti-aliasing is enabled, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setAntiAlias(boolean)` |   |

### hasMipMap

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun hasMipMap(): Boolean
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the mipmap hint is set, false otherwise. If the bitmap is null, this method always returns false. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setMipMap(boolean)` |   |

### isCircular

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun isCircular(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the image is circular, else `false`. |

### setAlpha

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setAlpha(alpha: Int): Unit
```

### setAntiAlias

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setAntiAlias(aa: Boolean): Unit
```

Enables or disables anti-aliasing for this drawable. Anti-aliasing affects the edges of the bitmap only so it applies only when the drawable is rotated.

| Parameters |
|---|---|
| `aa: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the bitmap should be anti-aliased, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#hasAntiAlias()` |   |

### setCircular

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setCircular(circular: Boolean): Unit
```

Sets the image shape to circular.

This overwrites any calls made to `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#setCornerRadius(float)` so far.

### setColorFilter

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setColorFilter(cf: ColorFilter!): Unit
```

### setCornerRadius

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setCornerRadius(cornerRadius: Float): Unit
```

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

### setDither

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setDither(dither: Boolean): Unit
```

> [!CAUTION]
> **This function is deprecated.**   

### setFilterBitmap

```
fun setFilterBitmap(filter: Boolean): Unit
```

### setGravity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setGravity(gravity: Int): Unit
```

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

| Parameters |
|---|---|
| `gravity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the gravity |

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/Gravity.html` |   |

### setMipMap

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setMipMap(mipMap: Boolean): Unit
```

Enables or disables the mipmap hint for this drawable's bitmap. See `https://developer.android.com/reference/android/graphics/Bitmap.html#setHasMipMap(boolean)` for more information. If the bitmap is null, or the current API version does not support setting a mipmap hint, calling this method has no effect.

| Parameters |
|---|---|
| `mipMap: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | True if the bitmap should use mipmaps, false otherwise. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/RoundedBitmapDrawable#hasMipMap()` |   |

### setTargetDensity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setTargetDensity(canvas: Canvas): Unit
```

Set the density scale at which this drawable will be rendered. This method assumes the drawable will be rendered at the same density as the specified canvas.

| Parameters |
|---|---|
| `canvas: https://developer.android.com/reference/android/graphics/Canvas.html` | The Canvas from which the density scale must be obtained. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html#setDensity(int)` |   |
| `https://developer.android.com/reference/android/graphics/Bitmap.html#getDensity()` |   |

### setTargetDensity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setTargetDensity(density: Int): Unit
```

Set the density at which this drawable will be rendered.

| Parameters |
|---|---|
| `density: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The density scale for this drawable. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html#setDensity(int)` |   |
| `https://developer.android.com/reference/android/graphics/Bitmap.html#getDensity()` |   |

### setTargetDensity

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
fun setTargetDensity(metrics: DisplayMetrics): Unit
```

Set the density scale at which this drawable will be rendered.

| Parameters |
|---|---|
| `metrics: https://developer.android.com/reference/android/util/DisplayMetrics.html` | The DisplayMetrics indicating the density scale for this drawable. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/graphics/Bitmap.html#setDensity(int)` |   |
| `https://developer.android.com/reference/android/graphics/Bitmap.html#getDensity()` |   |

## Protected functions

### onBoundsChange

```
protected fun onBoundsChange(bounds: Rect): Unit
```