CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    23

    DirectShow flickering problems when resizing

    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?

  2. #2
    Join Date
    Nov 2006
    Posts
    1,611

    Re: DirectShow flickering problems when resizing

    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).
    If my post was interesting or helpful, perhaps you would consider clicking the 'rate this post' to let me know (middle icon of the group in the upper right of the post).

  3. #3
    Join Date
    Aug 2008
    Posts
    23

    Re: DirectShow flickering problems when resizing

    Thank you very much
    The use of a child window did the trick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured