I’m am trying to read a .bmp file called circle1.bmp. It is in a package that I have imported into the following file.
So far I have the following code, but when I run the following code I get:
javax.imageio.llOException: Can’t read input file!
public void setUp() throws IOException
{
BufferedImage image = ImageIO.read(new File("circle1.bmp"));
byte[][] greenInputData = new byte[30][40];
for (int x = 0; x < inputData.length; x++)
{
for (int y = 0; y < inputData[x].length; y++)
{
int color = image.getRGB(x, y);
//alpha[x][y] = (byte)(color>>24);
//red[x][y] = (byte)(color>>16);
greenInputData[x][y] = (byte)(color>>8);
//blue[x][y] = (byte)(color);
}
}
this.inputData = greenInputData;
System.out.println(this.inputData);
}
You should try something like