Buster122296
asked on
CMainFrame
HELP!!! I am trying to draw a bitmap in the CMainFrame of my MDI
application. I am using VC 1.52. I have tried the following:
BOOL CMainFrame::OnEraseBkgnd(C DC* pDC)
{
CBitmap bitmap;
CDC dcMemory;
bitmap.LoadBitmap(IDB_BITM AP1);
dcMemory.CreateCompatibleD C(pDC);
CBitmap *obm = dcMemory.SelectObject(&bit map);
pDC->BitBlt(0,0,1400,500,& dcMemory,0 ,0,SRCCOPY );
dcMemory.SelectObject(obm) ; // have to reset DC state
before delting
return TRUE; // tell MFC that youv'e handled it, no
more erasing
required.
}
The bitmap flashes on the screen and then is erased to gray again.
What am I doing wrong?
<X-FONTSIZE><PARAM>12</PAR AM><FONTFA MILY><PARA M>Palatino </PARAM>HE LP!!! I am trying to draw a bitmap in the CMainFrame of my MDI
application. I am using VC 1.52. I have tried the following:
BOOL CMainFrame::OnEraseBkgnd(C DC* pDC)
{
CBitmap bitmap;
CDC dcMemory;
bitmap.LoadBitmap(IDB_BITM AP1);
dcMemory.CreateCompatibleD C(pDC);
CBitmap *obm = dcMemory.SelectObject(&bit map);
pDC->BitBlt(0,0,1400,500,& dcMemory,0 ,0,SRCCOPY );
dcMemory.SelectObject(obm) ; // have to reset DC state
before delting
return TRUE; // tell MFC that youv'e handled it, no
more erasing
required.
}
The bitmap flashes on the screen and then is erased to gray again.
What am I doing wrong?
</FONTFAMILY></X-FONTSIZE>
application. I am using VC 1.52. I have tried the following:
BOOL CMainFrame::OnEraseBkgnd(C
{
CBitmap bitmap;
CDC dcMemory;
bitmap.LoadBitmap(IDB_BITM
dcMemory.CreateCompatibleD
CBitmap *obm = dcMemory.SelectObject(&bit
pDC->BitBlt(0,0,1400,500,&
dcMemory.SelectObject(obm)
before delting
return TRUE; // tell MFC that youv'e handled it, no
more erasing
required.
}
The bitmap flashes on the screen and then is erased to gray again.
What am I doing wrong?
<X-FONTSIZE><PARAM>12</PAR
application. I am using VC 1.52. I have tried the following:
BOOL CMainFrame::OnEraseBkgnd(C
{
CBitmap bitmap;
CDC dcMemory;
bitmap.LoadBitmap(IDB_BITM
dcMemory.CreateCompatibleD
CBitmap *obm = dcMemory.SelectObject(&bit
pDC->BitBlt(0,0,1400,500,&
dcMemory.SelectObject(obm)
before delting
return TRUE; // tell MFC that youv'e handled it, no
more erasing
required.
}
The bitmap flashes on the screen and then is erased to gray again.
What am I doing wrong?
</FONTFAMILY></X-FONTSIZE>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also see this yourself by using the Spy++ application that comes with VC. Just click on the binoculars, and drag the target cursor over the app - you'll see the window outlines.