?? bmp2dat_gray.cpp
字號:
// bmp2dat_gray.cpp : 定義控制臺應(yīng)用程序的入口點。
//
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
FILE *in;
errno_t err;
err = fopen_s(&in,"./gray3noised.bmp","r");
ofstream out("gray3.dat");
fseek(in,0,SEEK_END);
int size=0,datastart=0x0436-1;
size = ftell(in);
unsigned int ch;
unsigned char ach;
out<<"1651 1 0 0 0"<<endl;
for(long i=size-1;i>datastart;i--)
{
fseek(in,i,SEEK_SET);
ch = fgetc(in);
ach=ch;
ch=ach;
out<<"0x"<<setw(4)<<setfill('0');
out<<hex<<ch<<endl;
out.flush();
}
out.close();
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -