Here you can find the source of drawNormalImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight)
public static void drawNormalImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight)
//package com.java2s; import java.awt.Graphics2D; import java.awt.Image; import java.awt.geom.Rectangle2D; import java.awt.image.ImageObserver; public class Main { public static void drawNormalImage(Rectangle2D bounds, Graphics2D g2, Image image, ImageObserver observer, int imageWidth, int imageHeight) { int x = (int) bounds.getX(); int y = (int) bounds.getY(); int w = Math.min(imageWidth, (int) bounds.getWidth()); int h = Math.min(imageHeight, (int) bounds.getHeight()); // no scaling is done here - note it uses only (x, y) coordinates, not width and height g2.drawImage(image, x, y, x + w, y + h, 0, 0, w, h, /* g2.getColor(),*/ observer); }/*w w w . j av a 2 s . c om*/ }