Java BufferedImage Load loadImage(URL resource)

Here you can find the source of loadImage(URL resource)

Description

load Image

License

Open Source License

Declaration

public static BufferedImage loadImage(URL resource) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.imageio.ImageIO;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.net.URL;

public class Main {
    public static BufferedImage loadImage(URL resource) {
        BufferedImage image = null;
        try {/*w w  w  . j a  v  a2s  . com*/
            image = ImageIO.read(resource);
        } catch (IOException e) {
        }
        return image;
    }

    public static BufferedImage loadImage(File f) {
        BufferedImage image = null;
        try {
            image = ImageIO.read(f);
        } catch (IOException e) {
        }
        return image;
    }
}

Related

  1. loadImage(String imageName, Component c)
  2. loadImage(String path)
  3. loadImage(String path)
  4. loadImage(String resourceName)
  5. loadImage(String url)
  6. loadImage(URL url)
  7. loadImageData(BufferedImage image)
  8. loadImageData(String name)
  9. loadImageFromBytes(byte[] bytes)