Socheat KHAUV
07/11/2020, 3:56 PMImage(asset = CustomAndroidImageAsset(bitmap = p.bitmap))
But some how when framework starting to draw the image. there is an implementation inside AndroidCanvas.kt call the following function
image.asAndroidBitmap()
This function always throw UnsupportedOperationException("Unable to obtain android.graphics.Bitmap")
which is correct because my CustomAndroidImageAsset is not AndroidImageAsset.
Mabye you could expose AndroidImageAsset for external use as well ?Adam Powell
07/11/2020, 4:08 PMp.bitmap
is an android.graphics.Bitmap
, you can use the provided Bitmap.asImageAsset()
to get one, making your initial code
Image(p.bitmap.asImageAsset())
Socheat KHAUV
07/11/2020, 4:15 PM