Looking at DrawScope documentation, <https://devel...
# compose
l
Looking at DrawScope documentation, https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.html#public-methods, I did not find any method for drawing a
Vector Drawable
: is there a way to do it ?
Ok, it seems I can do like this
Copy code
val vectorDrawable = VectorDrawableCompat.create(context.resources, imageRef, null)
vectorDrawable?.setBounds(x, y, x + imageSize - 1, y + imageSize - 1)
                    drawIntoCanvas {
                        vectorDrawable?.draw(it.nativeCanvas)
                    }
z
painterResource
supports vector drawables, I’m pretty sure.
l
Thank you, but it seems to me that it is not compatible with`DrawScope.`
z
Did you look at the docs for
Painter
? The first method is an extension on
DrawScope
.