Swing & Batik: Create an ImageIcon from an SVG file?

前端 未结 5 2191
我寻月下人不归
我寻月下人不归 2021-01-31 19:35

Simply put, I\'m looking for a way to make an ImageIcon from an SVG file using the batik library. I don\'t want to have to raster the SVG to disk first, I just want to be able

5条回答
  •  一整个雨季
    2021-01-31 20:03

    If ever you no longer wish to include the dependency on Batik in your application you can transform a SVG file directly into Java2D with the Flamingo SVG Transcoder:

    http://ebourg.github.com/flamingo-svg-transcoder

    It generates icon classes roughly equivalent in size to a compressed SVG file. The code generated has no external dependency.

提交回复
热议问题