captureAsyncAndShare

suspend fun CaptureController.captureAsyncAndShare(fileName: String = "capture_shared", imageType: CapturableSaveImageType = CapturableSaveImageType.PNG(100))

Capture and share Image

also see CaptureController.captureAsync

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 = {
scope.launch {
captureController.captureAsyncAndShare(
fileName = "Ticket",
imageType = CapturableSaveImageType.PNG(100),
)
}
}) { ... }

Parameters

fileName

Do not add an extension with a dot ('.'), the appropriate extension will be automatically applied based on the ImageType.

imageType

Share Type PNG or JPEG CapturableSaveImageType