Hi guys,

I noticed that my DIBs, both saved and copied to the clipboard, are 2 bytes short.

Code:
DWORD dwSize=sizeof(BITMAPINFO)+height*span;
HGLOBAL hGlobal=GlobalAlloc(GMEM_MOVEABLE,dwSize);
LPBYTE mem=(LPBYTE)GlobalLock(hGlobal);
...
// fill in BITMAPINFO
BITMAPINFO* bmi=(BITMAPINFO*)mem;
...
// copy bits
LPBYTE bits=mem+sizeof(BITMAPINFO)+2;
// if I don't add the +2 the colors are shifted
...
Where are those 2 bytes coming from ?

My filesize is always 2 bytes smaller than the same bitmap saved in Photoshop, and if I copy to clipboard the colors are shifted by two bytes (red is blue, green is red, blue is green.)

Thanks