Re: Graphics 102 : regional refresh of form/control
- From: Rob Schieber <schiebrc@xxxxxxxxxxx>
- Date: Thu, 27 Oct 2005 15:46:08 -0400
Peter Oliphant wrote:
Ok, I may have a partial answer to my own question. There is a Control method called Invalidate() that let's me invalidate any rectangular region of the Control. So this is what I was looking for.
BUT - does this mean that Refresh() only refreshes invalidated areas? Does drawing a graphic (ala the Graphics class, for example the use of DrawLine()) automatically invalidate the graphic object's region? If so, I don't need to do anything more than what I'm already doing! : )
[==P==]
"Peter Oliphant" <poliphant@xxxxxxxxxxxxxxxx> wrote in message news:%23CEAWko2FHA.1292@xxxxxxxxxxxxxxxxxxxxxxx
I now have graphics being drawn in the Paint event of my form (yeah, and it's very cool). Problem was that it only updated any changes to these graphics when Paint was called.
So, I then made it so the Refresh() method of the form was called for each graphic object. In this case it drew just fine, but Paint was being called so often I lost control of the form (e.g., trying to close the form using the close 'x' in upper right corner resulted in an hour-glass icon and no action). I then made it so it only called refresh once every so often. Now all is good...
BUT - I'd like to be able to refresh only a portion (rectangular region) of the form for speed. I notice all the .NET Control's can do this. I also don't think the Control's Refresh() has an overloaded version that establishes the rectangle of refresh.
Is there a 'region refresh' for controls (or possibly just for containers or forms), and what is it if it does exist?
Thanks in advance! : )
[==P==]
Peter,
InvalidateRect and Update seem to be the winning combo for me. I'm not sure what the offical answer is though.
-- Rob Schieber .
- References:
- Graphics 102 : regional refresh of form/control
- From: Peter Oliphant
- Graphics 102 : regional refresh of form/control
- Prev by Date: Re: OnPrepareDC
- Next by Date: Re: Kanji character display in 7.1 MFC application vs. 6.0 MFC
- Previous by thread: Graphics 102 : regional refresh of form/control
- Next by thread: Re: MFC Integration/Migration
- Index(es):
Relevant Pages
|