Java Utililty Methods BufferedImage from Image

List of utility methods to do BufferedImage from Image

Description

The list of methods to do BufferedImage from Image are organized into topic(s).

Method

BufferedImagebufferImage(Image image)
Create a BufferedImage from an Image.
BufferedImage bufferedImage = null;
int imageWidth = image.getWidth(null);
int imageHeight = image.getHeight(null);
if (imageWidth > 0 && imageHeight > 0) {
    bufferedImage = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
    Graphics g = bufferedImage.getGraphics();
    g.drawImage(image, 0, 0, null);
return bufferedImage;