import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import java.io.IOException;
//图片到二维数组
public static int[][] imageToArray(String path) throws IOException{
File file = new File(path);
BufferedImage image = ImageIO.read(file);
int width = image.getWidth();
int height = image.getHeight();
int[][] array = new int[width][height];
for(int i=0;i
将List转换为数组 Int[width][height]
int[][] array = new int[width][height];
List<Integer> list = new ArrayList<Integer>();
for(int i=0;i<width;i++){
for(int j=0;j<height;j++){
array[i][j] = list.getItem(i*height+j);
}
}