ok answering my own question it is quite simple using
setFitWidth/setFitHeight already today.
ImageView renderingView ....
renderingView.setFitWidth(width / scaleFactor);
renderingView.setFitHeight(height / scaleFactor);
I already tested that before sending out this mail but unfortunately it
did not work because I had a reflection effect on the parent node and it
took the whole day to track down that I run a bug with the
Reflection-Effect I documented at [1].
Tom
[1] https://bugs.openjdk.java.net/browse/JDK-8278170
Am 02.12.21 um 11:35 schrieb Tom Schindl:
Hi,
I'm try to get a HiDPI-Image produced by an external application into
JavaFX using WritableImage.
In the end the situation is comparable to what you get today when
loading an image from an URL (eg [email protected]) where JavaFX sets the
appropriate image pixelScale on "com.sun.prism.Image".
If I'm not completely mistaken I would need an new API on PixelBuffer to
containing the pixelScale who is used QuantumImage to create an
appropriate "com.sun.prism.Image" who has eg the pixelScale = 2.0
because I fed in a HiDPI-Image already.
Before filing an ehancement I wanted to bring this up here because maybe
I'm missing something obvious or maybe my proposal makes totally no sense.
Tom