:brain: Theoretical question, but is it possible s...
# compose-desktop
n
🧠 Theoretical question, but is it possible somehow hijack the rendering of Swing/JavaFx components to draw on composable layout? So not using swing components at all, just their render engine. For example, I want to hijack WebView rendering from Swing and draw all the contents in composable/skiko
a
Sure, you can draw a JComponent into a BufferedImage and then convert that to a Skiko image and draw that in compose (I don’t remember the exact APIs, but I’m sure they exist). It wouldn’t be very performant, though.
🙌 1
r
I imagine that a WebView already does something like this and doesn't draw directly with Swing's Graphics APIs so it would be doubly expensive
z
Could you use drawWithCanvas, get the native canvas out, then tell your WebView to draw into that? I think that would effectively be the same as just embedding the component though, as far as drawing is concerned.
r
WebVuew doesn't draw via Canvas