المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : From HANDLE to BITMAPINFO - another basic question for gurus



C++ Programming
01-13-2013, 10:30 PM
Found this very useful piece of code to get bitmap info from handle and would like to know HOW it works.
I think if I get how the LPBITAMPINFO gets filled I probably will also understand why using global handle is necessary. Or maybe not.

// a DIB is in the clipboard, draw it out
GLOBALHANDLE hGMem ;
LPBITMAPINFO lpBI ;
void* pDIBBits;
OpenClipboard() ;
hGMem = GetClipboardData(CF_DIB) ;
ASSERT(hGMem);
TRACE("\nfills LPBITMAPINFO");
lpBI = (LPBITMAPINFO)GlobalLock(hGMem) ;

Appreciate any help.
CHeers Vaclav