Chris Fillmore
04/22/2021, 1:16 AMComposeView
to draw a composition into a Canvas, off-screen? More or less this:
val canvas = Canvas()
val composeView = ComposeView(context)
composeView.setContent {
// Call composables here
SideEffect {
composeView.draw(canvas)
}
}
Important to note that the ComposeView is never attached to a window / drawn in the UI. The view is created programmatically, as above.
I am ultimately trying to get the composition into a Bitmap for the purpose of drawing into an OpenGL texture. (If there is a better approach, I’m all ears.) Thanks for any help!romainguy
04/22/2021, 1:53 AMromainguy
04/22/2021, 1:53 AMromainguy
04/22/2021, 1:54 AMChris Fillmore
04/22/2021, 1:56 AMChris Fillmore
04/22/2021, 1:58 AMView
or @Composable
), not just plain unstructured canvas drawing.Chris Fillmore
04/22/2021, 1:59 AMromainguy
04/22/2021, 2:18 AMromainguy
04/22/2021, 2:18 AMromainguy
04/22/2021, 2:18 AMromainguy
04/22/2021, 2:19 AMAdam Powell
04/22/2021, 2:19 AMViewTreeFoo
things ComposeView looks forChris Fillmore
04/22/2021, 2:39 AMChris Fillmore
05/06/2021, 2:45 PMPresentation
targeting a VirtualDisplay
backed by a Surface(SurfaceTexture)
romainguy
05/06/2021, 3:56 PM