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

# toDataUri

`fun <ERROR CLASS>.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).

