<br><br><div class="gmail_quote">On Sun, May 22, 2011 at 6:49 PM, Hans-Peter Diettrich <span dir="ltr"><<a href="mailto:DrDiettrich1@aol.com">DrDiettrich1@aol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Max Vlasov schrieb:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
- There are some functions, for example region-related in windows that nevertheless process full job even if the area the developer is drawing is not included in the window update region<br>
- There are internal off-screen manipulation so the developer himself have to do the job of avoiding extra processing so needs to know what the update region is .<br>
</blockquote>
<br></div>
I use to restrict expensive painting to the ClipRect. The entire painting has to be organized into kind of "objects", which reside in distinct parts of the entire canvas - just like controls reside in distinct parts of the client area. Before retrieving the entire painting information, I get the object's rectangle and check whether it intersects with the ClipRect. If not, painting is skipped for that object.<br>
<br></blockquote></div><br>Ok, another example. Imagine that two alpha png is merged and drawed on the form on the fly. And you drag a small window over this form. My experience tells me that win32 will do great automatic job of narrowing the final drawing of the bitmap to smallest rectangle possible, but my internal procedures of alpha-blending can get this information only from GetUpdateRect/GetUpdateRgn, otherwise every single pixel moving of this window will lead to full alpha-blending of these bitmaps. ClipRect won't provide this information<br>
<br>Max<br>