I have a few icons in .ico files in my C++ MFC program. I use DrawIcon and DrawIconEx to draw them onto a memory bitmap and they come out with some sort of shadow-like border at the edge of the edges of the visible content. The pixels look like they are in the transparent part of the icon and in the area that I drew in as white. Windows appears to be
I have edited the .ico files with Axialis IconWorkshop, Visual Studio, and looked at them with a few online ico-to-png converters. They look fine until I draw with them. they were okay for years and something changed in the last few years with Windows 8 or Windows 10.
Any ideas how to draw these things right?
Here's how one of my icons look in an icon editor:
And then how they look wrong in my program (blown up for you to see better):
I'm looking for possible viewport-window or other device context settings that might have some effect on this stuff.
I almost posted my own answer because DrawIconEx seemed to fix the problem because I have a high DPI display. But at closer inspection, the garbage is still there, just at the proper smaller pixel count, not scaled up by the DrawIcon function.