Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another bitmap question..

Status
Not open for further replies.

peterworth

Programmer
Aug 18, 2004
80
GB
i'm having trouble understanding what to pass to the CBitmap::CreateBitmap function as the const void* lpBits parameter. on the msdn website it says it should be a short int array but in the BITMAP structure, lpBits is a byte array. what should it be, and how are the colours represented by whatever data type is in each element of the buffer?

thanks.
 
what could be wrong with this (in the OnDraw function of a view)?

WORD wBits[] = {0x00,0x22,0x44,0x88,0x00,0x22,0x44,0x88,
0x22,0x44,0x88,0x00,0x22,0x44,0x88,0x00,
0x44,0x88,0x00,0x22,0x44,0x88,0x00,0x22,
0x88,0x00,0x22,0x44,0x88,0x00,0x22,0x44};
CBitmap bitmap;
bitmap.CreateBitmap(32,32,1,1,wBits);
CDC dcMemory;
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
pDC->BitBlt(0, 0, 8, 4, &dcMemory, 0, 0, SRCCOPY);

nothing is dispayed at the moment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top