C
CodeFusion
Guest
Hello all,
Ive created a control Ive placed onto a dialog (mostly for testing purposes). The control has a transparent background. Ive added code to the dialog to draw random images in OnPaint(). I have a timer which calls Invalidate 10 times a second. Ive overridden OnEraseBkgnd on both the CDialog and the control to not erase the background to reduce flicker. I also grab a copy of the background in the controls OnEraseBkgnd method. When its time to draw the control, I blit the background onto a back buffer and then draw the control on top of that. After drawing the control I blit the back buffer to the screen. What I see is that all controls are erased in the dialogs OnPaint() method, however, every control but my custom control redraws itself without flicker. I suspect my control is the last to be drawn. Either my control is taking too long to draw (sometimes, not all the time) or its order in the drawing cycle causes it to be drawn too late. I would prefer CDialog to draw on a back buffer and only blit to the screen after every control has drawn itself. Does anyone have any suggestions to eliminate the flicker?
Thanks,
Continue reading...
Ive created a control Ive placed onto a dialog (mostly for testing purposes). The control has a transparent background. Ive added code to the dialog to draw random images in OnPaint(). I have a timer which calls Invalidate 10 times a second. Ive overridden OnEraseBkgnd on both the CDialog and the control to not erase the background to reduce flicker. I also grab a copy of the background in the controls OnEraseBkgnd method. When its time to draw the control, I blit the background onto a back buffer and then draw the control on top of that. After drawing the control I blit the back buffer to the screen. What I see is that all controls are erased in the dialogs OnPaint() method, however, every control but my custom control redraws itself without flicker. I suspect my control is the last to be drawn. Either my control is taking too long to draw (sometimes, not all the time) or its order in the drawing cycle causes it to be drawn too late. I would prefer CDialog to draw on a back buffer and only blit to the screen after every control has drawn itself. Does anyone have any suggestions to eliminate the flicker?
Thanks,
Continue reading...