[2/2] gdiplus: fix GdipCreateBitmapFromHBITMAP flipping images vertically

Vincent Povirk vincent at codeweavers.com
Tue Feb 17 15:12:05 CST 2009


GdipCreateBitmapFromHBITMAP currently assumes that all bitmaps are top-down, even though a positive height (which it also assumes) signals a bottom-up DIB. The net result is that GdipCreateBitmapFromHBITMAP flips images vertically.

To properly convert a bottom-up DIB using GdipCreateBitmapFromScan0, one must use a negative stride and adjust the scan0 pointer to point to the top-most scanline.

If the bitmap isn't a DIB section, bm.bmBits will be NULL, and adjusting the pointer is a bad idea. What we should do in that case is use a different function to read the bitmap. Instead of doing that, I've skipped the adjustment and added a FIXME.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-gdiplus-fix-GdipCreateBitmapFromHBITMAP-flipping-im.patch
Type: application/octet-stream
Size: 1340 bytes
Desc: 0002-gdiplus-fix-GdipCreateBitmapFromHBITMAP-flipping-im.patch
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20090217/021b8e7b/attachment.obj 


More information about the wine-patches mailing list