Kirill Grouchnikov
11/16/2020, 9:59 PMImageBitmap
)? In general, there doesn't seem to be a way, maybe by design, to get access to the underlying pixel information for direct manipulation. AndroidImageAsset
and DesktopImageAsset
go through a somewhat of a contortion to expose the underlying pixel information to the ImageBitmap
, but I don't see any way to get those pixels afterwards.cb
11/16/2020, 10:09 PMtoPixelMap()
which gives you read access to the pixels. You say manipulation, as in to mutate the pixel array values?Kirill Grouchnikov
11/16/2020, 10:28 PMImageBitmap
out of the final buffer.Nader Jawad
11/17/2020, 12:13 AMtoPixelMap
api on ImageBitmap or provide your own array to store pixel information using readPixels
Kirill Grouchnikov
11/17/2020, 12:43 AMImageAsset
or also on ImageBitmap
?Nader Jawad
11/17/2020, 12:43 AMImageAsset
is renamed to ImageBitmap
ImageAsset
that points to ImageBitmap
toPixelMap
is an extension method on ImageBitmap
which would need an explicit import.Kirill Grouchnikov
11/17/2020, 12:46 AMreadPixels
for two things. Get pixels from an existing image, and also do that same "remapping" trick as in AndroidImageAsset
and DesktopImageAsset
to map a dynamically created buffer of pixels to a compose image object that can be drawn on a canvas.ImageAsset
, and then it's going to throw an UnsupportedOperationException
while drawing it on a canvas