I wrote a program which loads a bitmap file (only) to a window, and it's works fine for any file with .bmp
extansion. But I faced with the next problem when I was making a testing. I took a file with .jpg
extansion, opened it in Paint
and then saved it as a BMP file. When I was starting a test with this new file, my program loaded a black window.
I made a debug and find out that biColorUsed
field of BITMAPINFOHEADER
structure is zero. According to doc, this means that
the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression.
biCompression
field is also zero which means that file is uncompressed.
biBitCount
is equal to 24 which means (according to same docs) that
The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER
It couldn't be specified because biClrUsed
is zero.
So, the question is, is BMP
file created by a conversion of JPG
file using Paint
realy a BMP
file?
P. S.
I use CreateDIBitmap function in my program. When I load the same BMP
file using LoadImage, it works fine.
Any other fields of structures BITMAPFILEHEADER
, BITMAPINFOHEADER
is loaded correctly. That's why I think that I properly load data from BMP
file. I could upload my project on GoogleDrive and then share it if this would be needed.