类似于以下内容......除了让它工作:
public void seeBMPImage(String BMPFileName) throws IOException {
BufferedImage image = ImageIO.read(getClass().getResource(BMPFileName));
int[][] array2D = new int[66][66];
for (int xPixel = 0; xPixel < array2D.length; xPixel++)
{
for (int yPixel = 0; yPixel < array2D[xPixel].length; yPixel++)
{
int color = image.getRGB(xPixel, yPixel);
if ((color >> 23) == 1) {
array2D[xPixel][yPixel] = 1;
} else {
array2D[xPixel][yPixel] = 1;
}
}
}
}