How to export canvas to Png image and save it to gallery in jetpack compose?
I created an application for image editing. I create some effected-on images from the gallery but can't save them after editing them.
This is an example of a canvas that I want to save as png.
var resizedBitmap: Bitmap? = null
Canvas(modifier = Modifier.fillMaxSize(0.75f)) {
val canvasWidth = size.width
val canvasHeight = size.height
with(painter) {
draw(painter.intrinsicSize)
}
drawRect(black, size = size.copy(width = size.width /...