title: Does g.drawImage() render only the part of the image visible on a JPanel, or does it "keep in mind" the rest of the image?
body: <p>Let's say we have the following code:</p>
  
  <p>(in a class that extends <code>JPanel</code>):</p>
  
  <pre><code>public void paintComponent(Graphics g) {
      g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
  }
  </code></pre>
  
  <p>If <code>dx1</code> and <code>dy1</code> are negative or <code>dx2</code> and <code>dy2</code> are larger than the width of the <code>JPanel</code> (in other words, part of the image will be off-screen), does <code>drawImage()</code> adjust what is rendered so that it only "pays attention to" the part visible on the <code>JPanel</code>? I am curious about this because if I draw a very large image on the <code>JPanel</code>, <code>paintComponent()</code> could get slow.</p>