Java Image to BufferedImage ImageToBufferedImage(Image image, int width, int height)

Here you can find the source of ImageToBufferedImage(Image image, int width, int height)

Description

Image To Buffered Image

License

Open Source License

Declaration

private static BufferedImage ImageToBufferedImage(Image image, int width, int height) 

Method Source Code

//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;
    }
}

Related

  1. getBufferedImage(Image image)
  2. getBufferedImage(Image img)
  3. getBufferedImage(java.awt.Image image)
  4. getScaledBufferedImage(Image icon, double scale)
  5. imageToBufferedImage(Image image)
  6. imageToBufferedImage(Image img)
  7. imageToBufferedImage(Image img)
  8. imageToBufferedImage(Image pImage)
  9. imageToBufferedImage(Image src)