 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rod Guest
|
Posted: Mon Jul 17, 2006 12:46 am Post subject: OnPaint GetUpdateRegion |
|
|
In the wxWindows system you can determine within the OnPaint procedure
the region with needs to be updated:
void DrawPanel::OnPaint(wxPaintEvent & event)
....
wxRegionIterator upd(GetUpdateRegion());
while ( upd )
{
PaintClipBox = upd.GetRect();
upd++;
PaintClipBox.x += org.x;
PaintClipBox.y += org.y;
wxDCClipper * dcclip = new wxDCClipper(paintDC, PaintClipBox);
ReDraw(&paintDC, TRUE);
delete dcclip;
}
....
http://www.wxwindows.org/manuals/2.6.3/wx_wxpaintevent.html#wxpaintevent
How can I do that in Delphi/Paintbox? |
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Mon Jul 17, 2006 2:04 am Post subject: Re: OnPaint GetUpdateRegion |
|
|
See GDI calls "GetUpdateRgn" and "GetRegionData". You must first create a
dummy region with e.g. CreateRectRgn, then call GetUpdateRgn, then call
GetRegionData to obtain the RGNDATA information, then iterate through all
the rectangles in it.
If you're only interested in the encompassing update rectangle (So you only
call your redraw once), then see TCanvas.ClipRect.
Hope that helps,
Nils
www.simdesign.nl
"Rod" <999 (AT) 999 (DOT) com> schreef in bericht
news:44ba97a5$1 (AT) newsgroups (DOT) borland.com...
| Quote: | In the wxWindows system you can determine within the OnPaint procedure the
region with needs to be updated:
void DrawPanel::OnPaint(wxPaintEvent & event)
...
wxRegionIterator upd(GetUpdateRegion());
while ( upd )
{
PaintClipBox = upd.GetRect();
upd++;
PaintClipBox.x += org.x;
PaintClipBox.y += org.y;
wxDCClipper * dcclip = new wxDCClipper(paintDC, PaintClipBox);
ReDraw(&paintDC, TRUE);
delete dcclip;
}
...
http://www.wxwindows.org/manuals/2.6.3/wx_wxpaintevent.html#wxpaintevent
How can I do that in Delphi/Paintbox? |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|