JengaCaptureFrame

fun JengaCaptureFrame(shape: JengaCaptureShape, modifier: Modifier = Modifier, ready: Boolean = false, holdProgress: Float? = null, onFrameBoundsChange: (Rect) -> Unit? = null, colors: JengaCaptureFrameColors = JengaCaptureFrameDefaults.colors())(source)

A capture guide drawn over a camera preview: a frame in shape, with the area outside it dimmed. The border turns to the ready color when ready, and holdProgress draws a line around the outline while the user holds still.

The frame sits a little above the middle and is sized from the width, shrinking to fit short (landscape) spaces.

Parameters

shape

the frame outline; see JengaCaptureShape.

modifier

the Modifier for the overlay (typically fillMaxSize).

ready

whether the frame shows the ready color.

holdProgress

progress from 0 to 1 drawn around the outline; null for none.

onFrameBoundsChange

called with the frame's bounds in pixels, relative to this overlay, e.g. to crop the photo to the frame.

colors

the color set; defaults to JengaCaptureFrameDefaults.colors.

Samples

JengaCaptureFrame(
    shape = JengaCaptureShape.Rectangle(
        aspectRatio = 1.586f,
    ),
    modifier = Modifier.fillMaxSize(),
    ready = false,
    holdProgress = 0.4f,
)