Java BufferedImage Load loadImage(String filePath)

Here you can find the source of loadImage(String filePath)

Description

load image

License

Apache License

Parameter

Parameter Description
filePath a parameter

Declaration

public static BufferedImage loadImage(String filePath) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import javax.imageio.ImageIO;

import java.awt.image.BufferedImage;
import java.io.File;

public class Main {
    /**/* ww w  . jav a  2s .c  om*/
     * load image
     *
     * @param filePath
     * @return
     */
    public static BufferedImage loadImage(String filePath) {
        try {
            return ImageIO.read(new File(filePath));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. loadImage(String classRelativeFile)
  2. loadImage(String filename)
  3. loadImage(String fileName)
  4. loadImage(String fileName, Component c)
  5. loadImage(String fileName, Component component)
  6. loadImage(String i, int x, int imageWidth, int imageHeight)
  7. loadImage(String image)
  8. loadImage(String imageName)
  9. loadImage(String imageName, Component c)