you won't get a negative height with GetObject,
Hmm, is GdipCreateBitmapFromHBITMAP doing it right, then? It assumes all DIB objects have positive stride.
No, that's wrong. It should most likely just do a GetDIBits (in one go, not line by line like it currently does).
Does that mean there's no way to access the bits directly given a DIB object?
I think we do it line by line so that we don't rely on GdipCreateBitmapFromScan0 to create the bitmap with a particular stride. I guess we could specify a stride when calling that.
you won't get DIB info at all for DDBs.
I don't think it makes sense to do this for DDBs, as I can't draw them directly and don't expect them to have alpha information.
Sure, but it shouldn't crash and burn.
I don't understand why it would. I'd expect the GetObject to fail given sizeof(DIBSECTION) if the object is a DDB.