r/JavaFX • u/SandwichNo4142 • Oct 19 '25
Help No way to render pixel perfect.
For very long time I had issues to render synthetically created graphics in javaFX pixel perfect when the scaling factor is 125%.
Now I thought, I would have a way to go directly to the GNode's Graphic object and write there a texture directly to it.
Sad to say, the texture seems to map only the virtual pixels and not the real physical pixels.
This is sad, because even the old swing framework had an approach to do so.
Has anybody found out a way to determine the physical pixels of a component?
5
Upvotes
View all comments
Show parent comment
1
u/SandwichNo4142 Oct 29 '25
Unter Swing gibt es das AbstractMultiResolutionImage . Bei diesem implementiert man die Methode public Image getResolutionVariant(double destImageWidth, double destImageHeight) . Das sind dann die physikalischen Pixel.