一 读取 bmp图片数据 // 获取待检测图像 ,数据保存在数组 nData[],nB[] ,nG[] ,nR[]中 public void getBMPImage(String source) throws Exception { clearNData(); //清除数据保存区 FileInputStream fs = null; try { fs = new FileInputStream(source); int bfLen = 14; byte bf[] = new byte[bfLen]; fs
read(bf, 0, bfLen); // 读取 14字节 BMP文件头 int biLen = 40; byte bi[] = new byte[biLen]; fs
read(bi, 0, biLen); // 读取 40字节 BMP信息头 // 源图宽度 nWidth = (((int) bi[7] & 0xff)