0
我正在尝试读取名为circle1
的.bmp文件,该文件是已导入包含以下方法的类的包。在java中读取.bmp文件时抛出llOExcption
到目前为止,我有下面的代码,但是当我运行下面的代码我得到:
javax.imageio.llOException:无法读取输入文件!
public void setUp() throws IOException
{
// minimumOverlapScore < synapsesPerSegment(not yet a field)
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);
}
是jar里面的bmp,还是磁盘上的文件? – Bohemian