Java BufferedImage Load loadImageFromFile(String fileName)

Here you can find the source of loadImageFromFile(String fileName)

Description

load Image From File

License

Open Source License

Declaration

public static Image loadImageFromFile(String fileName) 

Method Source Code


//package com.java2s;
import java.awt.Image;

import java.io.File;

import java.io.IOException;

import javax.imageio.ImageIO;

public class Main {
    public static Image loadImageFromFile(String fileName) {
        try {/*from w  w w.j av  a 2 s  . c o m*/
            return ImageIO.read(new File(fileName));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. loadImageData(BufferedImage image)
  2. loadImageData(String name)
  3. loadImageFromBytes(byte[] bytes)
  4. loadImageFromFile(File f)
  5. loadImageFromFile(File file)
  6. loadImageFromFile(String filename)
  7. loadImageFromFile(String filepath)
  8. loadImageFromFile_ORIG(String imgName)
  9. loadImagefromJar(Object refObj, String fileName)