2011/5/22 Zaher Dirkey <[email protected]> > > 2011/5/22 Max Vlasov <[email protected]> > >> Hi, >> I encountered a problem I don't know how to solve. >> >> In Delphi I used the following trick. In the WM_Paint before inheried call >> I got update region with successive calls to GetUpdateRect (to determine if >> it exists) and GetUpdateRgn afterwards. This allowed to get the correct >> region before BeginPaint is called (it validates the region so getting it >> after BeginPaint makes no sense). >> >> But in Lazarus WM_Paint handler already contains DC and also GetUpdateRect >> call is failed. As I understand, this is because the WindowProc from >> win32callback.inc already did BeginPaint and provided the dc for the >> following call to the control WM_Paint. >> >> >> Max Vlasov >> >> > Check Canvas.ClipRect > > >
Zaher, thanks, but this is irrelevant, clipping rects and regions is just the way to define canvas/device context limiting area until explicitly canceled. It was used by Delphi and (probably) Lazarus to implement TGraphicControl, component working almost as TWinControl but without window handles. The update region is the region formed by multiply InvalidateRect and InvalidateRgn calls and it exists until BeginPaint is called as a result of Wm_paint message. Invalidation is more correct way to redraw anything on the window (vs direct drawing when necessary) Max Max
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
