bmp.palette is being set to the bitmapinfo.bmiColors (the palette in the structure) address space, so when we read in the palette from the file, it reads into that address space and then because bitmapinfo is used to draw the image, it has everything needed? Just say yes, so we can leave.
Code:if(!(bmp.palette = (RGBQUAD*) ((BYTE*)bmp.bitmapInfo + sizeof(BITMAPINFOHEADER)))) if(!fread(bmp.palette, sizeof(RGBQUAD), bmp.nColors, file))




Reply With Quote