, however my source vector is bounded very tightly so I need to add some "padding" to that)
Copy code
val imageBitmap = drawable.toBitmap().asImageBitmap()
val shader = ImageShader(imageBitmap, TileMode.Repeated, TileMode.Repeated)
ShaderBrush(shader)
In View world I'd create a Canvas backed by Bitmap where I'd precalculate the size and drawBitmap in the center, and then pass the bitmap instance to the shader.
In compose however I'm not sure how to go from Canvas to ImageBitmap
r
romainguy
01/18/2023, 10:58 PM
You can do the same
romainguy
01/18/2023, 10:59 PM
Create the larger bitmap and its Canvas, draw your source bitmap in it, then use asImageBitmap()