Transparent background in the WebView in JavaFX

后端 未结 6 1932
后悔当初
后悔当初 2020-12-19 00:50

I need to show my webview content over parent background pattern. Is there a straightforward way to do it?

6条回答
  •  抹茶落季
    2020-12-19 01:45

    You can Chroma Key your WebView over your content using Blend effects.

    Update

    I tried this out and implementing a true Chroma Key with the built-in Blend effects of JavaFX 2.2 in JavaFX is actually pretty difficult (and surpassed my capabilities of implementing). I managed to make the technique work with pre-chroma keyed flv video formats, but not with arbitrary nodes such as WebView.

    Still, for now, you can achieve something somewhat similar in a simple way using the darken and lighten effects as martini suggests in his answer. It's not perfect, but will probably need to suffice until RT-25004 is implemented or the JavaFX platform provides a more comprehensive set of alpha compositing operations.

提交回复
热议问题