[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

You can scroll a sub-rectangle of a raster in any direction--up, down,
left, right, or diagonally. To perform a scroll, you use the
ScrollRaster() routine and specify a dx and dy (delta-x, delta-y) by which
the rectangle image should be moved relative to the (0,0) location.

As a result of this operation, the data within the rectangle will become
physically smaller by the size of delta-x and delta-y, and the area
vacated by the data when it has been cropped and moved is filled with the
background color (color in BgPen). ScrollRaster() is affected by the Mask

Here is the syntax of the ScrollRaster() function:

    ScrollRaster(&rastPort, dx, dy, xmin, ymin, xmax, ymax);

The &rastPort argument is a pointer to a RastPort.  The dx and dy
arguments are the distances (positive, 0, or negative) to move the
rectangle.  The outer bounds of the sub-rectangle are defined by the xmin,
xmax, ymin and ymax arguments.

Here are some examples that scroll a sub-rectangle:

    /* scroll up 2 */
    ScrollRaster(&rastPort, 0, 2, 10, 10, 50, 50);

    /* scroll right 1 */
    ScrollRaster(&rastPort, -1, 0, 10, 10, 50, 50);

When scrolling a Simple Refresh window (or other layered RastPort),
ScrollRaster() scrolls the appropriate existing damage region.  Refer to
the "Intuition Windows" chapter for an explanation of Simple Refresh
windows and damage regions.

When scrolling a SuperBitMap window ScrollRaster() requires a properly
initialized TmpRas.  The TmpRas must be initialized to the size of one
bitplane with a width and height the same as the SuperBitMap, using the
technique described in the "Area-Fill Information" section above.

If you are using a SuperBitMap Layer, it is possible that the information
in the BitMap is not fully reflected in the layer and vice-versa.  Two
graphics calls, CopySBitMap() and SyncSBitMap(), remedy these situations.
Again, refer to the "Intuition Windows" chapter for more on this.

[Back to Amiga Developer Docs]