Fast Repainting when scrolling
Spencer Jones -- Spencer@azure.com
Monday, January 20, 1997
Environment: MSVC 4.0 Win NT 4.0
I have a view that displays a large DIB. I have included scrolling that
allows the DIB to be scrolled without updating the whole of the image.
My problem is this works fine as long as there is nothing floating in
the client area.
If there is something floating in the client area, the invalid region is
the scrolled area and the dialog. This can mean the whole client area
needs updating, rather than just the scrolled rectangle and the edge of
the dialog. What I have tried is to record the number of pixels scrolled
and modifying the invalid rect to be this only. However the
ScrollWindow() function then leaves an invalid area where the image has
scrolled past the dialog.
Is there a way to get the list of all dialogs that are on the client
area so that I can create an invalid region of just the part of the
client that is being scrolled from behind the dialogs?
Spencer Jones
Chief Software Developer
Azure Limited
E-Mail (spencer@azure.com)
Web Page (http://www.azure.com/~spencer)
User Location Service (uls.azure.com)
Bing Hou -- hou@tfn.com
Wednesday, January 22, 1997
Spencer,
I don't know if this is your case, the ScrollDC function scrolls part of a
window's client area and leaves _child_ windows statioinary, it only moves
the surface of the window underneath them.
Bing Hou
hou@tfn.com
======================
Jambalaya Baby!!!
======================
______________________________ Reply Separator _________________________________
Subject: Fast Repainting when scrolling
Author: Spencer Jones at Internet
Date: 1/20/97 2:11 PM
Environment: MSVC 4.0 Win NT 4.0
I have a view that displays a large DIB. I have included scrolling that
allows the DIB to be scrolled without updating the whole of the image.
My problem is this works fine as long as there is nothing floating in
the client area.
If there is something floating in the client area, the invalid region is
the scrolled area and the dialog. This can mean the whole client area
needs updating, rather than just the scrolled rectangle and the edge of
the dialog. What I have tried is to record the number of pixels scrolled
and modifying the invalid rect to be this only. However the
ScrollWindow() function then leaves an invalid area where the image has
scrolled past the dialog.
Is there a way to get the list of all dialogs that are on the client
area so that I can create an invalid region of just the part of the
client that is being scrolled from behind the dialogs?
Spencer Jones
Chief Software Developer
Azure Limited
E-Mail (spencer@azure.com)
Web Page (http://www.azure.com/~spencer)
User Location Service (uls.azure.com)
rick cameron -- rick_cameron@msn.com
Wednesday, January 29, 1997
Some background:
- a window has an 'update region', which is the part of the client area that
needs to be painted
- a region is a collection of rectangles
- when BeginPaint is called (as in CView::OnPaint), the update region of the
window is reset
- a DC has a clip region
- BeginPaint sets the clip region of the paint DC to be equivalent to the
update region of the window
- Win16 and Win32 both have a GetUpdateRegion call that operates on an HWND
(and MFC wraps it as CWnd::GetUpdateRgn)
- Win32 has a GetClipRgn call that operates on an HDC (but MFC doesn't wrap
it)
- Win32 has a GetRegionData call that returns a list of all the rectangles in
the region (which MFC wraps as CRgn::GetRegionData)
So:
- if your window has its own OnPaint, you can get hold of the update region
before calling BeginPaint
- if your window is a CView, you can (under Win32) get the clip region of the
paint DC
- given a region, under Win32 you can use GetRegionData to enumerate & draw
the dirty rectangles
- alternatively, you could use CRgn::PtInRegion or CRgn::RectInRegion to
hit-test & reduce drawing
- rick
On January 20, 1997 6:11, owner-mfc-l@majordomo.netcom.com on behalf of
Spencer Jones wrote:
> Environment: MSVC 4.0 Win NT 4.0
>
> I have a view that displays a large DIB. I have included scrolling that
> allows the DIB to be scrolled without updating the whole of the image.
> My problem is this works fine as long as there is nothing floating in
> the client area.
>
> If there is something floating in the client area, the invalid region is
> the scrolled area and the dialog. This can mean the whole client area
> needs updating, rather than just the scrolled rectangle and the edge of
> the dialog. What I have tried is to record the number of pixels scrolled
> and modifying the invalid rect to be this only. However the
> ScrollWindow() function then leaves an invalid area where the image has
> scrolled past the dialog.
>
> Is there a way to get the list of all dialogs that are on the client
> area so that I can create an invalid region of just the part of the
> client that is being scrolled from behind the dialogs?
>
>
> Spencer Jones
> Chief Software Developer
> Azure Limited
> E-Mail (spencer@azure.com)
> Web Page (http://www.azure.com/~spencer)
> User Location Service (uls.azure.com)
>
>
| Вернуться в корень Архива
|