Click to See Complete Forum and Search --> : DirectShow flickering problems when resizing
monoceres
May 31st, 2009, 06:32 PM
Hi!
I'm developing a video player but I'm having problems, when I resizing the window that containg the video the display flicker horribly. I'm using windowlessmode with the VMR9 renderer.
The flicker comes from windows repainting the background color before directshow is redrawing the frame. Any idea how to stop this?
JVene
May 31st, 2009, 07:52 PM
Stop painting the background color.
Sounds strange if you've not encountered the flicker problem in other contexts, but that's typically how it's done.
In typical situations like dialogs, we usually have child controls which are themselves windows, and tell the parent window to "clip children" by setting that style at the parent window's creation. In that way the parent's background painting clips the children such that they aren't overpainted (flickered).
Another scenario comes to play when blitting the entire window surface, like a hidden buffer painting scheme or when the entire client area of the window is displayed from a bitmap or series of bitmaps, such as a video player. In this case we assume the entire window will be covered by the blit of the bitmap, and so there's no need to even erase the background - none of it would ever be visible once the bitmap is blitted into position.
You can choose to set the background brush to NULL at the window creation and/or override the erase background message response function and do nothing (stopping the background painting).
monoceres
June 1st, 2009, 10:26 AM
Thank you very much :)
The use of a child window did the trick :)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.