Possible Duplicate:
Writing BMP image in pure c/c++ without other libraries
C++: Convert text file of integers into a bitmap image file in BMP format
http://www.fastgraph.com/help/bmp_header_format.html But how to write these into the file?
Possible Duplicate:
Writing BMP image in pure c/c++ without other libraries
C++: Convert text file of integers into a bitmap image file in BMP format
http://www.fastgraph.com/help/bmp_header_format.html But how to write these into the file?
Look at this link: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183374(v=vs.85).aspx
typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER, *PBITMAPFILEHEADER;
BITMAPFILEHEADER header;
// Fill your header;
std::ofstream of(/*your file name...*/);
of.write(&header, sizeof(header));
You can use any other file implementation instead of std::ofstream.