Java BufferedImage Load loadImageFromFile(File f)

Here you can find the source of loadImageFromFile(File f)

Description

load Image From File

License

Open Source License

Declaration

public static Image loadImageFromFile(File f) 

Method Source Code


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

import javax.imageio.ImageIO;
import java.awt.Image;

import java.io.File;

import java.io.IOException;

public class Main {
    public static Image loadImageFromFile(File f) {
        try {/*from   w ww.ja v a  2 s.  co m*/
            return ImageIO.read(f);
        } catch (IOException e) {
            System.out.println("Couldn't load image " + f.getPath());
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. loadImage(URL resource)
  2. loadImage(URL url)
  3. loadImageData(BufferedImage image)
  4. loadImageData(String name)
  5. loadImageFromBytes(byte[] bytes)
  6. loadImageFromFile(File file)
  7. loadImageFromFile(String filename)
  8. loadImageFromFile(String fileName)
  9. loadImageFromFile(String filepath)