Important: The information in this document is obsolete and should not be used for new development.
ScrollRectTo scroll the pixels of a specified portion of a basic graphics port's bitmap (or a color graphics port's pixel map), use the
PROCEDURE ScrollRect (r:\xDDRect; dh,dv: Integer; updateRgn: RgnHandle);
- The rectangle defining the area to be scrolled.
- The horizontal distance to be scrolled.
- The vertical distance to be scrolled.
- A handle to the region of the window that needs to be updated.
ScrollRectprocedure shifts pixels that are inside the specified rectangle of the current graphics port. No other pixels or the bits they represent are affected. The pixels are shifted a distance of
dvvertically. The positive directions are to the right and down. The pixels that are shifted out of the specified rectangle are not displayed, and the bits they represent are not saved. It is up to your application to save this data.
The empty area created by the scrolling is filled with the graphics port's background pattern, and the update region is changed to this filled area, as shown in Figure 2-8.
Figure 2-8 Scrolling the image in a rectangle by using the
ScrollRectprocedure doesn't change the local coordinate system of the graphics port; it simply moves the rectangle specified in the
rparameter to different coordinates. Notice that
ScrollRectdoesn't move the graphics pen or the clipping region. However, because the document has moved, they're in different positions relative to the document.
By creating an update region for the window,
ScrollRectforces an update event. After using
ScrollRect, your application should use its own window-updating code to draw into the update region of the window.
ScrollRectprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.
SEE ALSO"Scrolling the Pixels in the Port Rectangle" beginning on page 2-18 provides a general discussion of the use of
ScrollRect, and Listing 2-5 on page 2-19 illustrates how to use
ScrollRectto scroll through a document in a window.