code: @Override
      public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, 
              int sx1, int sy1, int sx2, int sy2, Color bgcolor, 
              ImageObserver observer) {
          Paint saved = getPaint();
          setPaint(bgcolor);
          fillRect(dx1, dy1, dx2 - dx1, dy2 - dy1);
          setPaint(saved);
          return drawImage(img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer);
      }
docs: Draws part of an image (defined by the source rectangle
  {@code (sx1, sy1, sx2, sy2)}) into the destination rectangle
  {@code (dx1, dy1, dx2, dy2)}.  The destination rectangle is first
  cleared by filling it with the specified {@code bgcolor}. Note that
  the {@code observer} is ignored.
  
  @param img  the image.
  @param dx1  the x-coordinate for the top left of the destination.
  @param dy1  the y-coordinate for the top left of the destination.
  @param dx2  the x-coordinate for the bottom right of the destination.
  @param dy2  the y-coordinate for the bottom right of the destination.
  @param sx1 the x-coordinate for the top left of the source.
  @param sy1 the y-coordinate for the top left of the source.
  @param sx2 the x-coordinate for the bottom right of the source.
  @param sy2 the y-coordinate for the bottom right of the source.
  @param bgcolor  the background color ({@code null} permitted).
  @param observer  ignored.
  
  @return {@code true} if the image is drawn.