I have a program which acquires images using a camera .Every thing is fine as long as it is not displaying images.
But i need to display images.I m using DIBs in this case.
I hav narrowed the bug to the DIBINFO header.

im fillig out the DIBINFO header like this

BITMAPINFO buf;

buf.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
buf.bmiHeader.biWidth = width;
buf.bmiHeader.biHeight = height;
buf.bmiHeader.biPlanes = 1;
buf.bmiHeader.biBitCount = 8;
buf.bmiHeader.biCompression = BI_RGB;
buf.bmiHeader.biSizeImage = width*height;
buf.bmiHeader.biXPelsPerMeter = 0;
buf.bmiHeader.biYPelsPerMeter = 0;
buf.bmiHeader.biClrUsed = 256;
buf.bmiHeader.biClrImportant = 0;
buf.bmiColors[0].rgbBlue = buf.bmiColors[0].rgbGreen = buf.bmiColors[0].rgbRed = 0;
buf.bmiColors[0].rgbReserved = 0;



I hope everthing is self explenatory.
Is there anything wrong in the I way fill it out.
OR is there any other way i can display images got from a camera ?