ServiceComposableBitmapRenderer
class ServiceComposableBitmapRenderer(application: Application, lifecycleOwner: LifecycleOwner = ProcessLifecycleOwner.get()) : ComposableBitmapRenderer
Use a virtual display to capture composable content thats on a display. This is necessary because Compose doesn't yet support offscreen bitmap creation (https://issuetracker.google.com/298037598)
Rebecca Frank's implementation https://gist.github.com/riggaroo/0e0072b3e85aa91443659031925fa47c
Original source: https://gist.github.com/iamcalledrob/871568679ad58e64959b097d4ef30738
Functions
Link copied to clipboard
open suspend override fun renderComposableToBitmap(canvasSize: DpSize, config: ImageBitmapConfig?, composableContent: @Composable () -> Unit): ImageBitmap?