Tag: vector graphics

将JUNG图导出为高分辨率图像(最好是基于矢量的)

在我的一个项目中,我使用JUNG2来显示一个非常大的多父层次结构图,显示在一个applet中。 我需要将图形的整个/部分导出为高分辨率静止图像,因为打印时屏幕截图看起来很可怕(特别是如果图形已经缩小)。 我目前使用的代码如下: public void writeToDisk(File saveToFolder, String filename) { //Dimension loDims = getGraphLayout().getSize(); Dimension vsDims = getSize(); int width = vsDims.width; int height = vsDims.height; Color bg = getBackground(); BufferedImage im = new BufferedImage(width,height,BufferedImage.TYPE_INT_BGR); Graphics2D graphics = im.createGraphics(); graphics.setColor(bg); graphics.fillRect(0,0, width, height); paintComponent(graphics); try{ ImageIO.write(im,”png”,new File(saveToFolder,filename)); }catch(Exception e){ e.printStackTrace(); } } 这会产生分辨率不是特别高的PNG图像。 所以我的问题如下: 是否可以将PNG输出分辨率提高到300 […]