On Wed, 10 Mar 2021 03:29:48 -0800 (PST), Elemich wrote:
running this code leads to the title question:
if you resize the window you will not see any flicker (repaint sended by the system)
if you move mouse inside the window, severe flicker will occurr (repaint sended by me)
how to reproduce the system-driven WM_PAINT?
Because the code directly draw on the application window, AND with added delays, you'll see the progress as flickers.
Use a technique called double buffering. Make the code draw on a separate
(off screen) bitmap first, then draw the bitmap onto the application window. It'll be a relatively slower process, but it'll minimize flickers. i.e. the display will be updated less frequently, but it'll minimize flickers.
However, if the area which need to be redrawn is large enough, it will still cause noticable flicker if the computer is not fast enough. IOTW, the whole process still take too much time to complete for the computer. That's where you'll notice the progress of the process. That's what flickers are when
those process are done repeatedly.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)