CanvasDrawScope

Class

Common
class CanvasDrawScope : DrawScope

Implementation of DrawScope that issues drawing commands into the specified canvas and bounds via CanvasDrawScope.draw

Functions

inline fun draw(
        density: Density,
        layoutDirection: LayoutDirection,
        canvas: Canvas,
        size: Size,
        block: DrawScope.() -> Unit,
    )

Draws into the provided Canvas with the commands specified in the lambda with this DrawScope as a receiver

Parameters

densityDensity used to assist in conversions of density independent pixels to raw pixels to draw
layoutDirectionLayoutDirection of the layout being drawn in.
canvastarget canvas to render into
sizebounds relative to the current canvas translation in which the DrawScope should draw within
blocklambda that is called to issue drawing commands on this DrawScope