[Lazarus] Getting update rect/region in Windows

Max Vlasov max.vlasov at gmail.com
Sun May 22 16:26:52 CEST 2011


On Sun, May 22, 2011 at 6:49 PM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com>wrote:

> Max Vlasov schrieb:
>
>
>  - 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
>> - 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 .
>>
>
> 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.
>
>
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

Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110522/b61e3a44/attachment-0003.html>


More information about the Lazarus mailing list