What is wrong with this code for writing grey-scale bmp from an image RGB bmp pure C - Windows OS
问题 This is my function, I am using the headers BMP according to wikipedia BITMAPINFOHEADER. But, I am getting a file without any image...when putting padding, the process stops. // Structures for header info #pragma pack(push,1) /* Windows 3.x bitmap file header */ typedef struct { char filetype[2]; /* magic - always 'B' 'M' */ unsigned int filesize; short reserved1; short reserved2; unsigned int dataoffset; /* offset in bytes to actual bitmap data */ } file_header; /* Windows 3.x bitmap full