Capturable

fun Capturable(controller: CaptureController, modifier: Modifier = Modifier, onCaptured: (ImageBitmap?, Throwable?) -> Unit, content: @Composable () -> Unit)

Deprecated

This Composable method has been deprecated & will be removed in the future releases. Use Modifier `capturable()` directly.

Deprecated: Use Modifier.capturable for replacement.

A composable with content which supports to capture ImageBitmap from a content.

Example usage:

val captureController = rememberCaptureController()
Capturable(
controller = captureController,
onCaptured = { bitmap, error ->
// Do something with [bitmap]
// Handle [error] if required
}
) {
// Composable content
}

Button(onClick = {
// Capture content
captureController.capture()
}) { ... }

Parameters

controller

A CaptureController which gives control to capture the content.

modifier

The Modifier to be applied to the layout.

onCaptured

The callback which gives back ImageBitmap after composable is captured. If any error is occurred while capturing bitmap, Throwable is provided.

content

Composable content to be captured.