-
Image data pre drawing
Hey, iv been wondering for a way to load an image but not draw the image onto the canvas but still retrieve data about its height, width etc. After trying it a few times iv found that the standard way of loading an image seems to only return the height and width data if it has been drawn to the canvas.
BufferedImage img = null;
try {
img = ImageIO.read(new File("strawberry.jpg"));
} catch (IOException e) {
}
Does anyone know what i should look into to store images or buffer images without having to display them and still be able to tell their size/ how much of the image data has been loaded/buffered? Any help to push me in the right direction would be appreciated :)
-
Have you looked at the API for BufferedImage? It contains methods for retrieving the width and height values