#include #include #include void main() { int i,j; char header[1078]; //256色bitmap header int image_row; int image_col; fstream image_in; //宣告一個fstream物件 char BM[2]; //檔頭前兩個bytes是字母BM,用以判別是否為bmp檔 char image_name[20]; cout <<"Input image file name: "<>image_name; //輸入影像名 image_in.open(image_name,ios::in | ios::binary);//以二進位模式開檔為讀取狀態 if(!image_in){ //如果image_in為真,表示無法開啟檔案 cerr << "Open "<< image_name<<" failed!"<