-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BITMAPFILEHEADER.bfOffBits is ignored #285
Comments
Makes me wonder what you can do with hacks where the bits would intentionally overlap with the bitmap header... or if you can embed custom metadata between the official headers and the bitmap data. |
Also, |
If the bits intentionally overlap with the bitmap header, the offset is ignored (in GDI+)
Yes you can! E.g. BYTE validOffset2OS2Indexed[] = {
// -- BITMAPFILEHEADER -- //
/* Signature */ 0x42, 0x4D,
/* File Size */ 0x24, 0x00, 0x00, 0x00,
/* Reserved */ 0x00, 0x00, 0x00, 0x00,
/* Offset */ 0x2E, 0x00, 0x00, 0x00,
// -- BITMAPCOREHEADER -- //
/* Size */ 0x0C, 0x00, 0x00, 0x00,
/* Width */ 0x01, 0x00,
/* Height */ 0x01, 0x00,
/* Planes */ 0x01, 0x00,
/* Bit Count */ 0x01, 0x00,
// -- Color Palette -- //
0xFF, 0x00, 0x00, 0x00, 0xFF, 0x0,
// -- Padding -- //
'H', 'i', 'd', 'd', 'e', 'n', ' ', 'M', 'e', 's', 's', 'a', 'g', 'e',
// -- Image Data -- //
0x80, 0x00, 0x00, 0x00
};
createFileSuccessDispose (validOffset2OS2Indexed, PixelFormat1bppIndexed, 1, 1, bmpFlags, FALSE);
ARGB expectedPixels[] = {0xFF00FF00};
verifyPixels (image, expectedPixels);
ARGB expectedPalette[] = {0xFF0000FF, 0xFF00FF00};
verifyPalette (image, 0, expectedPalette);
GdipDisposeImage (image); |
Cause of issue in #276 (review)
The text was updated successfully, but these errors were encountered: