Using vector graphics with JavaFX

4.9k views Asked by At

All the images in my app are currently jpg or png, which used to be okay. The GUI was a fixed size appropriate for whatever screen it would be displayed on and everyone was happy.

Now that hi-res and retina displays are more common, the app at its normal size looks small on some screens (or fuzzy if resized), so I'd like to update the graphics to adapt to any future resolution advances by converting them to vector images (eps or svg).

Before I go do this, does JavaFX have a way to use vector images in a similar way to ImageViews? It looks like ImageView itself only supports JPG, PNG, BMP, and GIF.

1

There are 1 answers

1
tomsontom On BEST ANSWER

No JavaFX does not support things like SVG directly but there are solutions like: - SVG to FXML - useage of a webview

BTW Image supports hi-res by using @2x notion eg you supply image.png and [email protected] and JavaFX choose the right one depending on the screen resolution