c++ - BitBlt draws a blank image -


i'm using mfc, , i'm trying draw image screen. i've got following ondraw function:

void cgraphicstestview::ondraw(cdc* pdc) {  cgraphicstestdoc* pdoc = getdocument();  assert_valid(pdoc);  if (!pdoc)   return;   m_bitmap.loadbitmap(idb_wall); // m_bitmap cbitmap member of cgraphicstestview                                    // idb_wall .png resource  cdc dcmemory;  dcmemory.createcompatibledc(pdc);  dcmemory.selectobject(&m_bitmap);  pdc->bitblt(10, 10, 32, 32, &dcmemory, 0, 0, srccopy); } 

this draw screen, destination area blank. bitblt working, since changing srccopy blackness draws black rectangle. see i'm missing?

i have guess problem image somehow invalid. because tested , works fine. loadbitmap returns hbitmap, test this:

hbitmap hresult = m_bitmap.loadbitmap(idb_wall); assert(hresult); 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -