record

fun DrawScope.record(layer: ImageLayer, block: DrawScope.() -> Unit)

Records block into layer, the counterpart of androidx's GraphicsLayer.record inside a DrawScope: block draws in this scope's coordinates and size, onto a recording aligned to the device pixels this scope draws on, so a drawContent() inside it records the content where it would have painted. Draw it back with ImageLayer.draw on DrawScope.graphics. Where the clip leaves nothing to draw, block does not run and layer is left empty.

Parameters

layer

the layer to record into, replacing what it held.

block

draws the recording.

See also