Here you can find the source of drawImage(Image img, double x, double y, Graphics2D graphics)
public static Graphics2D drawImage(Image img, double x, double y, Graphics2D graphics)
//package com.java2s; import java.awt.Graphics2D; import java.awt.Image; public class Main { /**/*w w w . j a v a 2 s. com*/ * Draws an entire image (full size) at the specified coordinates. */ public static Graphics2D drawImage(Image img, double x, double y, Graphics2D graphics) { graphics.drawImage(img, round(x), round(y), null); return graphics; } /** * Draws an entire image (full size) at the specified coordinates. */ public static Graphics2D drawImage(Image img, double x, double y, double w, double h, Graphics2D graphics) { graphics.drawImage(img, round(x), round(y), round(w), round(h), null); return graphics; } private static int round(double val) { return (int) Math.round(val); } }