hi. i tried to output a bitmap file but it seems to be invalid and hence, i can't open it.
I've assigned values to the BITMAPINFOHEADER and colour table. Using WriteFile method, I wrote the above BITMAPINFO into a bitmap file.
The raw pixel image is in a char array:
unsigned char ByteImage [200*152];
Do you know how to write the data in this ByteImage into the bitmap data part of the bitmap file?
I tried something like:
WriteFile(hFile, ByteImage, sizeof(ByteImage), &dwBytesWritten, NULL);
the bitmap file is created but it can't be opened for viewing, saying that the file is not a valid bitmap format. anybody knows what went wrong?
thanks alot
I've assigned values to the BITMAPINFOHEADER and colour table. Using WriteFile method, I wrote the above BITMAPINFO into a bitmap file.
The raw pixel image is in a char array:
unsigned char ByteImage [200*152];
Do you know how to write the data in this ByteImage into the bitmap data part of the bitmap file?
I tried something like:
WriteFile(hFile, ByteImage, sizeof(ByteImage), &dwBytesWritten, NULL);
the bitmap file is created but it can't be opened for viewing, saying that the file is not a valid bitmap format. anybody knows what went wrong?
thanks alot
Comment