Double buffer common controls

前端 未结 8 1154
不思量自难忘°
不思量自难忘° 2020-12-18 07:19

Is there a way to double-buffer the common controls? Currently when they resize they flicker. A lot.....

EDIT: If it helps, it is a bunch of button controls and a fe

8条回答
  •  渐次进展
    2020-12-18 07:44

    Look at using WS_EX_COMPOSITEDand WS_EX_TRANSPARENT styles. They provide doublebuffering, altough WM_PAINT will be called when the underlying bitmap is finished drawing, since it draws child controls from bottom to top, so you can paint only in your window procedure. I've used it in the past and work pretty well.

    Set your top-level window (container) to extended style WS_EX_COMPOSITED and your child windows with WS_EX_TRANSPARENT. Also, remember to define:

    #define WINVER 0x501 
    

    See CreateWindowEx for information on the composited style. This also makes possible to do perpixel transparency on child windows.

    UPDATE

    What about usign WM_PRINTCLIENT to transfer the client area to a bitmap on a DC and blit all the client area as a whole?

    http://blogs.msdn.com/larryosterman/archive/2008/08/27/larry-s-new-favorite-windows-message-wm-printclient.aspx

提交回复
热议问题