I'm trying to save snapshots of my JPanel as .png files. The problem is that the image I can create is 96DPI by default. Since this pictures have to be printed, I'd need an higher level of quality. Is there any way I can improve my image quality? Are there maybe smarter ways for taking snapshots of a JPanel? You can find herein attached part of my code, where the variable "c" stands for the JPanel. Thanks in advance.
//c stands for my JPanel
BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
//calculate x,y,width and height basing on the particular image crop I want to get
int x = roundToInt(cropFrame.getX()*panel.getScale()+groupPathways_layout.getX()-viewArea_data.getX());
int y = roundToInt(cropFrame.getY()*panel.getScale()+groupPathways_layout.getY()-viewArea_data.getY());
int w = roundToInt(cropFrame.getWidth()*panel.getScale());
int h = roundToInt(cropFrame.getHeight()*panel.getScale());
c.paint(im.getGraphics());
BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
bi.getGraphics().drawImage(im, 0, 0, w, h, x, y, x + w, y + h, null);
ImageIO.write(bi, "png", new File(path+"/"+name+imageFormat));