Reading image file in java

how to read an image in java and convert it to a buffered image?

+4
source share
2 answers

For this you need the Java 2D API. Here's a Sun tutorial about the subject. In the chapter Working with Images, you can learn how to read / download an image. Here is an excerpt from the textbook:

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

Source: https://habr.com/ru/post/1301346/


All Articles