[android-components](../../index.md) / [mozilla.components.support.ktx.android.graphics.drawable](../index.md) / [android.graphics.drawable.Drawable](index.md) / [toBitmap](./to-bitmap.md)

# toBitmap

`@JvmOverloads fun `[`Drawable`](https://developer.android.com/reference/android/graphics/drawable/Drawable.html)`.toBitmap(bitmapConfig: `[`Config`](https://developer.android.com/reference/android/graphics/Bitmap/Config.html)` = Bitmap.Config.ARGB_4444): `[`Bitmap`](https://developer.android.com/reference/android/graphics/Bitmap.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/graphics/drawable/Drawable.kt#L16)

Converts a Drawable to Bitmap. via https://stackoverflow.com/a/46018816/2219998.

