https://kotlinlang.org logo
#compose
Title
# compose
k

kioba

10/24/2019, 9:50 PM
can we decode Vector assets with
+imageResource(R.drawable.ic_face_primary_24dp)
? The method fails to generate the bitmap and throws
IllegalArgumentException("Problem decoding into existing bitmap")
I am not sure if I mess up or we can only decode Bitmaps atm
j

jim

10/24/2019, 9:55 PM
I believe the function you are looking for is:
+vectorResource(R.drawable.ic_face_primary_24dp)
It is generally considered best practice to avoid converting vectors into bitmaps whenever possible.
k

kioba

10/24/2019, 10:08 PM
Thanks Jim! 👍 that was the one I was looking for 🙂
4 Views