Paul Gofman gofmanp@gmail.com writes:
My tests show that the full color images (24bpp) are downsampled using HALFTONE stretch mode, 1 bit images use BLACKONWHITE (as it works now in Wine), and anything between works like COLORONCOLOR mode. HALFTONE mode is not currently supported by gdi32 and falls back to COLORONCOLOR (STRECTH_DELETESCANS). This still makes more sense than using BLACKONWHITE for color images, but does not allow to fit the test for 24bpp bitmap. It could probably look more appropriate to set COLORONCOLOR mode for color images with less than 24bpp, but this way it won't fit any of my tests at all by now without changing gdi32 stretch code. If STRECTH_DELETESCANS mode is used, stretch_bitmapinfo() in gdi32/dibdrv/bitblt.c takes a bit different (optimized) path and drops wrong scans (not those dropped on Windows or when HALFTONE mode is used). This difference should not matter much in practice in most cases though. I see the following possible ways:
- Use a more appropriate stretch mode in CopyImage() / LoadImage()
for color images regardless of gdi32 stuff. It will eliminate major image colors distortions currently introduced when ANDing color values during stretch.
We can certainly change this first, even if gdi32 doesn't do the right thing yet. But probably not during code freeze...