Use custom logo from gallery
Closed this issue · 2 comments
neelniloy commented
is there any way to use URI or Bitmap for the logo image?
alexzhirkevich commented
If URI is from android file system, you can use DrawableSource.File
. Otherwise you should pre-download it
You can use BitmapDrawable
and create custom DrawableSource
:
val bitmapDrawableSource = DrawableSource {
BitmapDrawable(resources, yourBitmap)
// or yourBitmap.toDrawable(resources)
}
But make sure that your bitmap is immutable. You can check it with Bitmap.isMutable
and make bitmap immutable with
val immutableBitmap = yourBitmap.copy(Bitmap.Config.ARGB_8888, /* isMutable= */false)
neelniloy commented
Thanks. Issue Solved