title: Getting High Resolution Image from JPanel
body: <p>Suppose I have a <code>JPanel</code> Called <code>panel</code>, and already with a <code>paintComponent</code>, I drew some shapes like rectangles. I can get a buffered image out of my panel like:</p>
  
  <pre><code>    int w = panel.getWidth();
      int h = panel.getHeight();
      BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
      Graphics2D g = bi.createGraphics();
      panel.paint(g);
      ImageIO.write(bi1, "png", new File("test.png"));
  </code></pre>
  
  <p>How can I get a High Resolution image out of my <code>panel</code>? (the current output image is just based on the resolution of my <code>JPanel</code> in my monitor) </p>
  
  <p>I tried <code>AffineTransform</code>, but it doesn't do what I need.</p>
  
  <p>Note that I already drew everything in my <code>panel</code>, and do not want to change my drawing in my <code>paintComponent</code> method.</p>
  
  <p>I am really searching for a practical way, and appreciate any help.</p>