Thread: win32 - how avoid flickers with transparent controls?

  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    451

    win32 - how avoid flickers with transparent controls?

    1 - for avoid flickers, we use: WS_CLIPCHILDREN on parent window style.
    2 - for be transparent we do:
    Code:
    case WM_ERASEBKGND:
                case WM_CTLCOLORBTN:
                case WM_CTLCOLORSTATIC:
                {
                    return (LRESULT)GetStockObject(NULL_BRUSH);
                }
                break;
    and now we can use the WM_PAINT for draw what we need.
    use:
    Code:
    RECT d;
                    GetClientRect(hwnd,&d);
                    RedrawWindow(hwnd,&d,nullptr,RDW_UPDATENOW | RDW_INVALIDATE);
    for repaint the control.
    now see the transparent flicker-free control.
    (if i draw a filled rectangle, the control backcolor is showed )
    so how can i redraw the control without that problem?(see the image... 1 image above another)
    win32 - how avoid flickers with transparent controls?-transparent-flicker-problem-gif

  2. #2
    Registered User
    Join Date
    Aug 2013
    Posts
    451
    how can i clear the control, when i use the WS_CLIPCHILDREN style?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ - win32 - How avoid flickers with RedrawWindow()?
    By joaquim in forum Windows Programming
    Replies: 2
    Last Post: 02-14-2015, 03:38 PM
  2. [win32] - how can i avoid controls flickers?
    By joaquim in forum Windows Programming
    Replies: 13
    Last Post: 02-01-2014, 02:45 AM
  3. [win32] - about static transparent and text
    By joaquim in forum Windows Programming
    Replies: 0
    Last Post: 01-31-2014, 08:35 AM
  4. Text box w/transparent bkgd flickers
    By Sfpiano in forum Windows Programming
    Replies: 2
    Last Post: 08-19-2007, 05:18 AM
  5. Transparent Static Controls, Non-MFC
    By X PaYnE X in forum Windows Programming
    Replies: 3
    Last Post: 08-06-2003, 10:32 PM