form background bitmap
-
Hi all! I've been tring to put a bitmap background image on the main Dialog but nearest i can get is this: CDC* pDC=GetDC(); CDC old; //New device context used as the source DC //Creates a deice context compatible to pDC old.CreateCompatibleDC(pDC); CBitmap dlg_bmp; CRect rect; GetClientRect(&rect); dlg_bmp.LoadBitmap(IDB_BITMAP3); CBitmap* oldbmp= old.SelectObject(&dlg_bmp); pDC->BitBlt(rect.left, rect.top, rect.Height(), rect.Width (),&old,0,0,SRCCOPY); old.SelectObject(oldbmp); dlg_bmp.DeleteObject(); //Deletes the bitmap Invalidate(); when this runs the bitmap is loaded and it overrun the other controls hiding them If some one help me i'd be very gratefull AI_Warrior
-
Hi all! I've been tring to put a bitmap background image on the main Dialog but nearest i can get is this: CDC* pDC=GetDC(); CDC old; //New device context used as the source DC //Creates a deice context compatible to pDC old.CreateCompatibleDC(pDC); CBitmap dlg_bmp; CRect rect; GetClientRect(&rect); dlg_bmp.LoadBitmap(IDB_BITMAP3); CBitmap* oldbmp= old.SelectObject(&dlg_bmp); pDC->BitBlt(rect.left, rect.top, rect.Height(), rect.Width (),&old,0,0,SRCCOPY); old.SelectObject(oldbmp); dlg_bmp.DeleteObject(); //Deletes the bitmap Invalidate(); when this runs the bitmap is loaded and it overrun the other controls hiding them If some one help me i'd be very gratefull AI_Warrior
You need to handle
WM_ERASEBKGND
and paint the bitmap in response to that message. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true. -
You need to handle
WM_ERASEBKGND
and paint the bitmap in response to that message. --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.