Here you can find the source of ImageToBufferedImage(Image image, int width, int height)
private static BufferedImage ImageToBufferedImage(Image image, int width, int height)
//package com.java2s; //License from project: Open Source License import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage; public class Main { private static BufferedImage ImageToBufferedImage(Image image, int width, int height) { BufferedImage dest = new BufferedImage(width, height, 2); Graphics2D g2 = dest.createGraphics(); g2.drawImage(image, 0, 0, null); g2.dispose();//from w w w . j ava 2 s .c om return dest; } }