I want to save the content of a canvis as an image...
# compose-desktop
d
I want to save the content of a canvis as an image on my hard drive
k
First, keep this to one message or start a thread. Second, you can use
ImageComposeScene
to wrap your content
👍 1
👍🏼 1
And then use a
LaunchedEffect
with a block along the lines of
Copy code
val image = scene.render()
 val bytes = image.encodeToData()!!.bytes
 val file = File(filename)
 file.writeBytes(bytes)
 scene.close()
😃 2
d
Thank you a ton for the help i didnt know the edicit. Thank a tone ill give this a try.