I have an SVG image created in Inkscape. I put it in the same directory as my class.
Is there a way to load that image and convert it to an SVG Path?
The idea behind this is to get that image with getClass().getResource("image.svg").toExternalForm()
and convert it to a SVGPath for the imageSVG.setContent()
method. After of that I want to put that SVGPath object in a Button with the button.setGraphic()
method.
I don't want to use Transcoders or BufferedImage class.
With the
SvgLoader
provided by https://github.com/afester/FranzXaver, you can simply load an SVG file as a JavaFX node and set it on the button as its graphic: