[android-components](../../index.md) / [mozilla.components.support.ktx.android.graphics](../index.md) / [android.graphics.Bitmap](index.md) / [toDataUri](./to-data-uri.md)

# toDataUri

`fun `[`Bitmap`](https://developer.android.com/reference/android/graphics/Bitmap.html)`.toDataUri(): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/graphics/Bitmap.kt#L19)

Transform bitmap into base64 encoded data uri (PNG).

