If I create a DIB using CreateDIBSection(), I can specify wether it should be top-down or bottom-up by setting the biHeight field of the BITMAPINFOHEADER struct to a negative or positive value. However, if i call GetObject() on such a bitmap to fill a DIBSECTION structure, then both the dsBm.bmHeight and dsBmih.biHeight seem to be always positive.
Is there a way to find out if a DIB is top-down or bottom-up when all I have is the HBITMAP?
I think the best you’re going to be able to get from an HBITMAP is going to be GetDIBits. The problem with GetDIBits however, is that it also requires an HDC and the HBITMAP has to be a DDB.
see: GetDIBits Function
I’m not positive, but its possible you’ll lose any top-downness in the conversion.