• <tfoot id='SKJ87'></tfoot>
    <legend id='SKJ87'><style id='SKJ87'><dir id='SKJ87'><q id='SKJ87'></q></dir></style></legend>

      <bdo id='SKJ87'></bdo><ul id='SKJ87'></ul>
    1. <i id='SKJ87'><tr id='SKJ87'><dt id='SKJ87'><q id='SKJ87'><span id='SKJ87'><b id='SKJ87'><form id='SKJ87'><ins id='SKJ87'></ins><ul id='SKJ87'></ul><sub id='SKJ87'></sub></form><legend id='SKJ87'></legend><bdo id='SKJ87'><pre id='SKJ87'><center id='SKJ87'></center></pre></bdo></b><th id='SKJ87'></th></span></q></dt></tr></i><div id='SKJ87'><tfoot id='SKJ87'></tfoot><dl id='SKJ87'><fieldset id='SKJ87'></fieldset></dl></div>

        <small id='SKJ87'></small><noframes id='SKJ87'>

      1. InvalidateRect 和 RedrawWindow 的区别

        时间:2023-08-01

            <tbody id='u06Zd'></tbody>
        1. <i id='u06Zd'><tr id='u06Zd'><dt id='u06Zd'><q id='u06Zd'><span id='u06Zd'><b id='u06Zd'><form id='u06Zd'><ins id='u06Zd'></ins><ul id='u06Zd'></ul><sub id='u06Zd'></sub></form><legend id='u06Zd'></legend><bdo id='u06Zd'><pre id='u06Zd'><center id='u06Zd'></center></pre></bdo></b><th id='u06Zd'></th></span></q></dt></tr></i><div id='u06Zd'><tfoot id='u06Zd'></tfoot><dl id='u06Zd'><fieldset id='u06Zd'></fieldset></dl></div>
          <legend id='u06Zd'><style id='u06Zd'><dir id='u06Zd'><q id='u06Zd'></q></dir></style></legend>

          <small id='u06Zd'></small><noframes id='u06Zd'>

            <bdo id='u06Zd'></bdo><ul id='u06Zd'></ul>
              <tfoot id='u06Zd'></tfoot>

                  本文介绍了InvalidateRect 和 RedrawWindow 的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  当我想重绘一个窗口时,有没有什么首选的函数可以在 InvalidateRect 和 RedrawWindow 之间调用?

                  When I want to redraw a window, is there any preferred function to call between InvalidateRect and RedrawWindow?

                  例如,这两个调用是否相等:(win 将是 HWND)
                  RedrawWindow(win, NULL, NULL, RDW_INVALIDATE);
                  InvalidateRect(win, NULL, NULL);

                  For instance, are these two calls equal: (win would be a HWND)
                  RedrawWindow(win, NULL, NULL, RDW_INVALIDATE);
                  InvalidateRect(win, NULL, NULL);

                  主要问题:我应该什么时候使用其中一个?背景中是否存在任何差异?(不同的 WM_messages/focus/order/priorities..)

                  The main question(s): When should I use one or the other? Are there any differences that happen in the background? (different WM_messages / focus / order / priorities..)

                  我想重绘窗口的原因是因为我向它发送了一个我希望它显示的新图像,这意味着窗口的内容不再有效.

                  The reason that I want to redraw the window is because I send a new image to it that I want it to display, meaning the content of the window is no longer valid.

                  推荐答案

                  InvalidateRect 不会立即重绘窗口.它只是为窗口的特定矩形区域安排"未来的重绘.使用 InvalidateRect 您可以根据需要安排任意数量的区域,使它们累积在一些内部缓冲区中.当窗口无事可做时,所有累积预定区域的实际重绘将在稍后进行.(当然,如果在您发出 InvalidateRect 调用时窗口处于空闲状态,则会立即进行重绘).

                  InvalidateRect does not immediately redraw the window. It simply "schedules" a future redraw for a specific rectangular area of the window. Using InvalidateRect you may schedule as many areas as you want, making them accumulate in some internal buffer. The actual redrawing for all accumulated scheduled areas will take place later, when the window has nothing else to do. (Of course, if the window is idle at the moment when you issue the InvalidateRect call, the redrawing will take place immediately).

                  您还可以通过调用 UpdateWindow 强制立即重绘所有当前累积的无效区域.但是,同样,如果您不着急,则没有必要显式调用 UpdateWindow,因为一旦窗口空闲,它将自动为所有当前无效的区域执行重绘.

                  You can also force an immediate redraw for all currently accumulated invalidated areas by calling UpdateWindow. But, again, if you are not in a hurry, explicitly calling UpdateWindow is not necessary, since once the window is idle it will perform a redraw for all currently invalidated areas automatically.

                  RedrawWindow 是一个具有更广泛和灵活的功能集的函数.它可用于执行失效调度(即与 InvalidateRect 所做的相同)或可用于强制执行指定区域的立即重绘,而不进行任何调度".在后一种情况下,调用 RedrawWindow 实际上等同于调用 InvalidateRect 然后立即调用 UpdateWindow.

                  RedrawWindow, on the other hand, is a function with a much wider and flexible set of capabilities. It can be used to perform invalidation scheduling (i.e. the same thing InvalidateRect does) or it can be used to forcefully perform immediate redrawing of the specified area, without doing any "scheduling". In the latter case calling RedrawWindow is virtually equivalent to calling InvalidateRect and then immediately calling UpdateWindow.

                  这篇关于InvalidateRect 和 RedrawWindow 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:CreateWindow/CreateDialog 中的 HWND 可以从另一个线程获 下一篇:如何在 Win32 上快速枚举目录?

                  相关文章

                  最新文章

                  <legend id='NZw5f'><style id='NZw5f'><dir id='NZw5f'><q id='NZw5f'></q></dir></style></legend>
                      <bdo id='NZw5f'></bdo><ul id='NZw5f'></ul>

                    <tfoot id='NZw5f'></tfoot>

                    <small id='NZw5f'></small><noframes id='NZw5f'>

                  1. <i id='NZw5f'><tr id='NZw5f'><dt id='NZw5f'><q id='NZw5f'><span id='NZw5f'><b id='NZw5f'><form id='NZw5f'><ins id='NZw5f'></ins><ul id='NZw5f'></ul><sub id='NZw5f'></sub></form><legend id='NZw5f'></legend><bdo id='NZw5f'><pre id='NZw5f'><center id='NZw5f'></center></pre></bdo></b><th id='NZw5f'></th></span></q></dt></tr></i><div id='NZw5f'><tfoot id='NZw5f'></tfoot><dl id='NZw5f'><fieldset id='NZw5f'></fieldset></dl></div>