core-ktx / androidx.graphics / android.graphics.Picture

Extensions for android.graphics.Picture

record

fun Picture.record(width: Int, height: Int, block: Canvas.() -> Unit): Picture

Creates a new Canvas to record commands in this Picture, executes the specified block on the newly created canvas and returns this Picture. Example: