Java Utililty Methods Image to BufferedImage

List of utility methods to do Image to BufferedImage

Description

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

Method

BufferedImageImageToBufferedImage(Image image, int width, int height)
Image To Buffered Image
BufferedImage dest = new BufferedImage(width, height, 2);
Graphics2D g2 = dest.createGraphics();
g2.drawImage(image, 0, 0, null);
g2.dispose();
return dest;
BufferedImageimageToBufferedImage(Image img)
image To Buffered Image
try {
    MediaTracker tracker = new MediaTracker(new Component() {
        private static final long serialVersionUID = 1L;
    });
    tracker.addImage(img, 0);
    tracker.waitForAll();
} catch (InterruptedException ie) {
    ie.printStackTrace();
...
BufferedImageimageToBufferedImage(Image img)
Converts a given Image into a BufferedImage
if (img instanceof BufferedImage) {
    return (BufferedImage) img;
BufferedImage bimage = new BufferedImage(img.getWidth(null), img.getHeight(null),
        BufferedImage.TYPE_INT_ARGB);
Graphics2D bGr = bimage.createGraphics();
bGr.drawImage(img, 0, 0, null);
bGr.dispose();
...
BufferedImageimageToBufferedImage(Image pImage)
image To Buffered Image
int w = pImage.getWidth(null);
int h = pImage.getHeight(null);
int type = BufferedImage.TYPE_INT_ARGB; 
BufferedImage lBufferedImage = new BufferedImage(w, h, type);
Graphics2D g2 = lBufferedImage.createGraphics();
g2.drawImage(pImage, 0, 0, null);
g2.dispose();
return lBufferedImage;
...
BufferedImageimageToBufferedImage(Image src)
image To Buffered Image
int width = 0;
int height = 0;
if (src != null) {
    width = src.getWidth(null);
    height = src.getHeight(null);
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
Graphics2D g = image.createGraphics();
...
BufferedImagemakeBufferedImage(final Image image)
make Buffered Image
BufferedImage bImg = new BufferedImage(image.getWidth(null), image.getHeight(null),
        BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = bImg.createGraphics();
g2.drawImage(image, null, null);
g2.dispose();
return bImg;
BufferedImagemakeBufferedImage(Image image)
make Buffered Image
return makeBufferedImage(image, BufferedImage.TYPE_INT_RGB);
BufferedImagemakeBufferedImage(Image image)
Creates a buffered image from the supplied image.
if (image == null)
    System.out.println("ImageUtilities l.67 Image null");
return makeBufferedImage(image, BufferedImage.TYPE_INT_RGB);
BufferedImagemakeRGBABufferedImageFromImage(Image image)
make RGBA Buffered Image From Image
if (image instanceof BufferedImage) {
    return (BufferedImage) image;
image = new ImageIcon(image).getImage();
boolean hasAlpha = hasAlpha(image);
BufferedImage bImage = null;
try {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
...
BufferedImagetoBufferedImage(Image i)
to Buffered Image
BufferedImage result = new BufferedImage(i.getWidth(null), i.getHeight(null), BufferedImage.TYPE_INT_ARGB);
Graphics2D g = result.createGraphics();
g.drawImage(i, 0, 0, null);
g.dispose();
return result;