captureAsyncAndSave
Capture and save Image To Gallery
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.captureAsyncAndSave(
fileName = "Ticket",
imageType = CapturableSaveImageType.PNG(100),
saveType = CapturableSaveType.Auto
)
}
}) { ... }Parameters
Do not add an extension with a dot ('.'), the appropriate extension will be automatically applied based on the ImageType.
Share Type PNG or JPEG CapturableSaveImageType
Share Type Auto,Pick and Gallery CapturableSaveType
Capture and save Image To Gallery
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.captureAsyncAndSave(
fileName = "Ticket",
imageType = CapturableSaveImageType.PNG(100),
saveType = CapturableSaveType.Auto
)
}
}) { ... }Parameters
Do not add an extension with a dot ('.'), the appropriate extension will be automatically applied based on the ImageType.
Share Type PNG or JPEG CapturableSaveImageType
Share Type Auto,Pick and Gallery CapturableSaveType
Capture and save Image To Gallery
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.captureAsyncAndSave(
fileName = "Ticket",
imageType = CapturableSaveImageType.PNG(100),
saveType = CapturableSaveType.Auto
)
}
}) { ... }Parameters
Do not add an extension with a dot ('.'), the appropriate extension will be automatically applied based on the ImageType.
Share Type PNG or JPEG CapturableSaveImageType
Share Type Auto,Pick and Gallery CapturableSaveType