-
public final class CapturableKt
-
-
Method Summary
Modifier and Type Method Description final static Modifiercapturable(Modifier $self, CaptureController controller)Adds a capture-ability on the Composable which can draw Bitmap from the Composable component. -
-
Method Detail
-
capturable
final static Modifier capturable(Modifier $self, CaptureController controller)
Adds a capture-ability on the Composable which can draw Bitmap from the Composable component.
Example usage:
val captureController = rememberCaptureController() val uiScope = rememberCoroutineScope() // The content to be captured in to Bitmap Column( modifier = Modifier.capturable(captureController), ) { // Composable content } Button(onClick = { // Capture content val bitmapAsync = captureController.captureAsync() try { val bitmap = bitmapAsync.await() // Do something with `bitmap`. } catch (error: Throwable) { // Error occurred, do something. } }) { ... }- Parameters:
controller- A CaptureController which gives control to capture the Composable content.
-
-
-
-