Question : Write compressed bmp file

I want to how to write bmp image to a file. so that it can be viewed using MS Paint.
I have read the bmp image and performed:
1 ) dct 2) Quantization and zigzag scanning. 3)dequantized and Inverse DCT ia apllied.
I have generated char unsigned Array[256][256] which stores the result. i want to know how to store the image (Header and pixel values). I have considered 256-bitmap file as input image.(bit depth 8 color image or gray scale image)

Answer : Write compressed bmp file

You will find the code in this artile:

Win32: Capture an image

Funtcion Capture makes an image and saves it in a file.

Standard BMP-file has a a file header (BITMAPFILEHEADER) in the beginning, then BITMAPINFOHEADER and the bit-array. Last two parts is the dib-section, actually.

There is a short and clear article in MSDN:

Storing an Image

Random Solutions  
programming4us programming4us