BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OnPaint GetUpdateRegion

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Rod
Guest





PostPosted: Mon Jul 17, 2006 12:46 am    Post subject: OnPaint GetUpdateRegion Reply with 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
Nils Haeck
Guest





PostPosted: Mon Jul 17, 2006 2:04 am    Post subject: Re: OnPaint GetUpdateRegion Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.