here's the problem: I have several images and would like to use them when displaying a HTML in JavaFX's WebView.
Current implementation is very obvious: there is a file, which is linked to in the HTML content. I assume that WebView does not regress from JEditorPane and will only do a single I/O operation even if the image is referenced 10 000 times throughout the content.
However, it would be great to have a single Image instance and feed it to WebView when it encounters the relevant <img> tag.
I have seen that there is a great half-solution involving URL handling, but the problem remains: you have an Image instance that you convert to a storage format (BMP, PNG with proprietary extensions, etc) and keep that in memory. However, this means that each time WebView desires an image resolution, it must then manually parse the image from binary data. In the end, you just have a file mapped to memory plus an internal Image instance instead of a shared Image instance.
With JEditorPane, you could push Images to its image cache and get rid of such problems. Unfortunately, since Java 7, that component is unusable and is out of question.
Basically, is there any chance WebView/WebEngine maintains such a cache/equivalent and is there a way to pre-populate it?