write XImage to .bmp file in C
问题 I am writing an XImage to a file "bitmap0.bmp" using the following code but when i open the newly created file with imageViewer in fedora it gives "Premature end of file" error and does not display anything. could anyone please point out the problem in the following code? typedef struct tagBITMAPFILEHEADER { WORD bfType; DWORD bfSize; WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; } BITMAPFILEHEADER; typedef struct tagBITMAPINFOHEADER{ DWORD biSize; LONG biWidth; LONG biHeight; WORD