Here you can find the source of drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height)
private static void drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height)
//package com.java2s; //License from project: Apache License import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; public class Main { private static void drawImage(BufferedImage originalImage, BufferedImage scaledImage, int width, int height) { Graphics2D g = scaledImage.createGraphics(); g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g.drawImage(originalImage, 0, 0, width, height, 0, 0, originalImage.getWidth(), originalImage.getHeight(), null);/*from w w w.ja v a2s .c o m*/ g.dispose(); } }