I'm using GraphicsContext.drawImage(img, x, y, w, h) to draw an image scaled to fit a region on my canvas. I'm noticing some aliasing artifacts due to the scaling. Does JavaFX have an equivalent to Swing's RenderingHints.VALUE_INTERPOLATION_BICUBIC?
Asked
Active
Viewed 1,721 times
0
-
Though there is no code to try. I would advice you to have a look at [`SceneAntialiasing.BALANCED`](https://docs.oracle.com/javase/8/javafx/api/javafx/scene/SceneAntialiasing.html#BALANCED) – ItachiUchiha May 15 '15 at 02:26
-
Also see related (but different) [JavaFX image without any smoothing](http://stackoverflow.com/questions/16089304/javafx-imageview-without-any-smoothing) – jewelsea May 15 '15 at 21:12
1 Answers
0
There are two ways to scale an image. One is to do the scaling via the drawing operator as you have done it and the other one is to scale the image itself when you load it. Some constructors of the Image class have parameters to specified the desired bounds of the image and in addition they have a parameter called "smooth" which, if set to true, should do what you want.

mipa
- 10,369
- 2
- 16
- 35