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
Post a Comment