I always use SetDiBitsToDevice, but drawDIBits can also be in order (not checked).
Regarding the inverted nature of blit window functions:
There is a workaround. If you pass a BITMAPINFOHEADER or BITMAPINFO structure, the function simply negates the value in the bitmap-height element. This will tell GDI to make blit as if the height were positive, but interpret the data as being stored in order from top to bottom.
You can get a good speed improvement thanks to this hack.
If you want to shuffle the byte order of the pixels (for example, turn ARGB to BGRA or so), you can use the BITMAPV4HEADER structure and tell GDI how your pixel data is organized. This is a feature that is rarely used, but works with WIN98. I would say that it saves to use it these days.
source
share