Over at https://github.com/python-pillow/Pillow/issues/8271, a user has posted a zip containing an EMF file - https://github.com/user-attachments/files/16448240/PillowIssue8271.zip
The user maintains that the white in this EMF file should be (255, 255, 255).
Running the following code, I find it to be (248, 248, 248).
HDC dc = CreateCompatibleDC(NULL);
BITMAPINFO info;
memset(&info, 0, sizeof(BITMAPINFO));
info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
info.bmiHeader.biWidth = 857;
info.bmiHeader.biHeight = 687;
info.bmiHeader.biPlanes = 1;
info.bmiHeader.biBitCount = 24;
info.bmiHeader.biCompression = BI_RGB;
void *ptr;
bitmap = CreateDIBSection(dc, &info, DIB_RGB_COLORS, &ptr, NULL, 0);
SelectObject(dc, bitmap);
HENHMETAFILE hemf = GetEnhMetaFile("test.emf");
RECT rect;
rect.left = 0;
rect.top = 0;
rect.right = 857;
rect.bottom = 687;
PlayEnhMetaFile(dc, hemf, &rect);
COLORREF color = GetPixel(dc, 200, 200);
printf("rgb %d %d %d\n", GetRValue(color), GetGValue(color), GetBValue(color));
The use of PlayEnhMetaFile
seems straightforward. Is anyone able to tell me if I've missed something, or if I'm correct and the colour really is (248, 248, 248).
Thanks for your time, let me know if there is a better place to have asked this question.