Dominaezzz
12/06/2020, 1:23 AMTimo Drick
12/06/2020, 12:10 PMfun scaleUsingSurface(image: Image, width: Int, height: Int): Image {
val surface = Surface.makeRasterN32Premul(width, height)
val canvas = surface.canvas
val paint = Paint().apply {
filterQuality = FilterQuality.HIGH
}
canvas.drawImageRect(image, Rect(0f, 0f, width.toFloat(), height.toFloat()), paint)
return surface.makeImageSnapshot()
}
Dominaezzz
12/06/2020, 12:34 PMStefan Oltmann
11/27/2023, 8:31 AMStefan Oltmann
11/27/2023, 8:10 PM