ursus
01/18/2023, 10:52 PMImageBitmap
instance?
(I'm trying to create a tiled shader Brush
, however my source vector is bounded very tightly so I need to add some "padding" to that)
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 ImageBitmapromainguy
01/18/2023, 10:58 PMursus
01/18/2023, 10:59 PM