Re: [Dev-C++] Help Please. ( Scrolling the client area with graphics)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <or...@vp...> - 2004-09-22 16:07:28
|
OROSZI Bal=E1zs wrote: > Added to this: > Note that Windows can move the entire contents of a window, and you onl= y=20 > need to repaint the "invalid" rectangle (a small portion) of your=20 > window, giving you great speedups (and to avoid flicker). Though you=20 > have to calculate that rectangle yourself. Process the scrollbar=20 > messages, and retrieve the amount that was scrolled, then use the=20 > ScrollWindowEx() function to move the contents of your window (your=20 > lines, etc.), then repaint the invalid rectangle (using BitBlt if you=20 > painted to a bitmap, or any other method). The invalid rectangle is wha= t=20 > you scrolled into view. A little correction: After you got the amount to the scroll, call ScrollWindowEx() with the SW= _INVALIDATE flag=20 then call UpdateWindow(). In your WM_PAINT message processor, use the PAINTSTRUCT's rcPaint rect, t= hat holds the=20 invalid rect. This way you don't need to calculate the rectangle yourself. If you're stuck, look here for a complete example: http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/shellc= c/platform/commctls/scrollbars/usingscrollbars.asp -- Greetings, Bal=E1zs |