Package 

Class CapturableKt

    • Method Summary

      Modifier and Type Method Description
      final static Modifier capturable(Modifier $self, CaptureController controller) Adds a capture-ability on the Composable which can draw Bitmap from the Composable component.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.