So I got the shell enumeration working correctly, I get all the names of the items and their associated images, including both thumbnails and image icons as necessary, and it matches what I see in Explorer. However, the problem I'm facing is that icons are returned upside-down, while thumbnails are returned right side up, and nothing in the associated DIBSECTION
points at a negative stride or negative height or anything of the kind (but otherwise they both store valid data that I'm using to render the images).
For an arbitrary thumbnail, I get the following:
While for an arbitrary icon I get the following:
As you can see all valid data, but the icon (the second set) is upside-down. The call that's generating this is using "bigger size ok", so it should be working correctly:
imageFactory.GetImage(new(200, 200), SIIGBF.SIIGBF_BIGGERSIZEOK, out var bitmap);
Also if I pass this HBITMAP to GDI+ it actually accounts for the upside down encoding, however I am unable to replicate it using GetObject
into a DIBSECTION
. What am I missing here to know when to reverse the lines without using GDI+?
NOTE: this is not a duplicate of whatever SO post you find about this, because every single working answer uses GDI+ to figure it out. This is specifically about NOT using GDI+.