BITMAPINFOHEADER::biClrUsed值,在某些APP(如光大)中需要指定用以表明调色板颜色数量

This commit is contained in:
gb 2023-12-26 17:24:04 +08:00
parent bfb5c45029
commit fcd6ea9121
1 changed files with 1 additions and 0 deletions

View File

@ -469,6 +469,7 @@ std::string scanned_img::file_header(SANE_ImageType type, float resolution)
pal_size = 2 * sizeof(int); pal_size = 2 * sizeof(int);
else if (bih.biBitCount == 8) else if (bih.biBitCount == 8)
pal_size = 256 * sizeof(int); pal_size = 256 * sizeof(int);
bih.biClrUsed = pal_size / sizeof(int); // some APP (PJScanner.exe 光大……) use this field to calculate pallete
{ {
BITMAPFILEHEADER fh = { 0 }; BITMAPFILEHEADER fh = { 0 };