MDIChildWnd flicker !!!
-
I set background bitmap for my MDIChildWnd >>> okay
void CTest2View::OnPaint() // MDIChildWnd { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here // My code to paint background.....draw to dc }
but When I resize MDIChildWnd, it 's flicker I can not fix it help me -
I set background bitmap for my MDIChildWnd >>> okay
void CTest2View::OnPaint() // MDIChildWnd { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here // My code to paint background.....draw to dc }
but When I resize MDIChildWnd, it 's flicker I can not fix it help meNormaly you would draw the background image in OnEraseBkgnd() which might solve part of your problem. Alternatly you can over ride OnEraseBkgnd(), so that it does not erase the background before OnPaint() is called, and do all the drawing in OnPaint(). There are some articles at codeproject on this subject and it is probably addressed in the FAQs. INTP
-
Normaly you would draw the background image in OnEraseBkgnd() which might solve part of your problem. Alternatly you can over ride OnEraseBkgnd(), so that it does not erase the background before OnPaint() is called, and do all the drawing in OnPaint(). There are some articles at codeproject on this subject and it is probably addressed in the FAQs. INTP
Could you show me more detail about this ? You mean: I do paint in CMDIChildWnd based class or CFormView based class of MDIChildWnd ?? in class which derive from CFormView have no WM_ERASEBKGND message ?! I also do paint in both but not result, when resize it still flicker. help me.......thanks:rose:
-
Could you show me more detail about this ? You mean: I do paint in CMDIChildWnd based class or CFormView based class of MDIChildWnd ?? in class which derive from CFormView have no WM_ERASEBKGND message ?! I also do paint in both but not result, when resize it still flicker. help me.......thanks:rose:
- Search for articals on flicker free drawing (at codeproject). Example: "Do a flicker-free drawing using MFC methods" 2) SDI, MDI, and Form windows are all directly or indirectly derived from CWnd which does receive a WM_ERASEBKGND message: Example: CWnd->CView->CScrollView->CFOrmView. Good luck! INTP