Question

I have seen it cause SVG-Salamander is small enough to my projects. But I don't know if i can use it for that neither how to do it.

I've use this code :

public static void main(String[] args) throws IOException, SVGException {
    // TODO Auto-generated method stub

    File f = new File("./src/game_scheme.svg");
    SVGUniverse svgUniverse = new SVGUniverse();
    SVGDiagram diagram = svgUniverse.getDiagram(svgUniverse.loadSVG(f.toURL()));
    BufferedImage bi = new BufferedImage(320, 240, BufferedImage.TYPE_INT_ARGB);
    Graphics2D ig2 = bi.createGraphics();
    diagram.render(ig2);
    ImageIO.write(bi, "PNG", new File("./yourImageName.png"));

}

But images are not smooth :( , any idea?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top