Here you can find the source of drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
private static void drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2)
//package com.java2s; /*/*from w ww .j a v a 2 s . c o m*/ * %W% %E% * * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ import java.awt.Graphics; import java.awt.Image; public class Main { private static void drawImage(Image image, Graphics g, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) { // PENDING: is this necessary, will G2D do it for me? if (dx2 - dx1 <= 0 || dy2 - dy1 <= 0 || sx2 - sx1 <= 0 || sy2 - sy1 <= 0) { // Bogus location, nothing to paint return; } g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null); } }