answer
May 8th, 2004, 11:35 PM
I read an article on the bitmap format. I learned it and able to use it :). Just one problem. I opened windows paint drew something, saved, and when I open with my program the bitmap is correct exept after it it has some random colors :confused:.
Heres my code
void OpenBMP(DIBSTRUCT *dib, HANDLE f)
{
BITMAPFILEHEADER bmfh;
BITMAPINFOHEADER bmih;
FileRead(f, &bmfh, sizeof(BITMAPFILEHEADER));
InitDib(dib);
FileRead(f, &bmih, sizeof(bmih));
CreateDib(dib, bmih.biBitCount, bmih.biWidth, bmih.biHeight); // Function I made for CreateDibSection
FileRead(f, dib->lpBits, bmih.biWidth*bmih.biHeight*(bmih.biBitCount>>3));
}
Anyone know how I may load the Bitmap Properly?
Thanx in advance!
Heres my code
void OpenBMP(DIBSTRUCT *dib, HANDLE f)
{
BITMAPFILEHEADER bmfh;
BITMAPINFOHEADER bmih;
FileRead(f, &bmfh, sizeof(BITMAPFILEHEADER));
InitDib(dib);
FileRead(f, &bmih, sizeof(bmih));
CreateDib(dib, bmih.biBitCount, bmih.biWidth, bmih.biHeight); // Function I made for CreateDibSection
FileRead(f, dib->lpBits, bmih.biWidth*bmih.biHeight*(bmih.biBitCount>>3));
}
Anyone know how I may load the Bitmap Properly?
Thanx in advance!