I am making a java program that reads a binary file, which contains multiple images (in PNG format), and some binary data.
How can i load the images (specifically, as java.awt.Image
's)? So far the only way i have found to load an image is via functions that just take a file. How can i do it from, say, an InputStream?
The ImageIO#read(InputStream)
method does return a java.awt.image.BufferedImage
(which extends from java.awt.Image
).
https://docs.oracle.com/javase/8/docs/api/javax/imageio/ImageIO.html#read-java.io.InputStream-
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.