Click to See Complete Forum and Search --> : RectVisible()


Sean
April 7th, 1999, 12:08 AM
When I run my MFC project, I use the scroll bars to reveal a part of the window that was previously hidden (obviously!). So in OnDraw when I call RectVisible() does this tell if a particular area of the window needs to be redrawn, i.e., if I scroll and a certain part of my window remains in view, but just moves a little with scroll bars, will RectVisible tell me that this area of the window does not need to be redrawn.
I am having some problems with this, in that the whole window is being redrawn when I scroll. So either RectVisible tells my program to redraw the whole window (???) or I'm passing the wrong parameters to RectVisible.
Can anybody explain what, exactly, RectVisible does?

Thanks,
Sean.

April 7th, 1999, 01:45 AM
RectVisible tell you when a rect is in a clipping region.
But you have to declare the clipping region by InvalidateRect or InvalidateRgn in place of Invalidate when you are scrolling.

Hope this helps