There are examples of creating an empty `ImageAsse...
# compose
k
There are examples of creating an empty
ImageAsset
and drawing on it - such as
ImageAssetSample
, but it's a chicken-and-egg problem. In order to be able to draw a dynamic "bitmap" onto it, such a bitmap would first need to already exist.
n
Similar to Android you can create an ImageAsset and pass it to the constructor of a Canvas and to draw into the ImageAsset (now called ImageBitmap)
k
But again, how do I "draw" an array of ints / pixels onto it?
This approach works to draw shapes, lines, points, etc. But not a dynamically created image.
n
Discussed offline. We will be adding a
setPixels
API to ImageAsset to configure the pixel information if it is retrieved from elsewhere. Thanks!
👍 1
k
Meanwhile I filed https://github.com/JetBrains/compose-jb/issues/111 as I can't even create an empty bitmap on desktop