akshay
akshay

Reputation: 115

Reading a image file in Jva

How to read a image in Java and convert it to buffered image?

Upvotes: 5

Views: 5973

Answers (2)

BalusC
BalusC

Reputation: 1108802

You need the Java 2D API for this. Here's a Sun tutorial about the subject. In the "Working with Images" chapter you can learn how to read/load an image. Here's an extract of the tutorial:

BufferedImage img = null;
try {
    img = ImageIO.read(new File("strawberry.jpg"));
} catch (IOException e) {

}

Upvotes: 7

extraneon
extraneon

Reputation: 23950

See ImageIO.read().

Upvotes: 2

Related Questions