Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Routines / Getting Pattern Resources


To get a pattern stored in a pattern list ('PAT#') resource, you can use the GetIndPattern procedure.

PROCEDURE GetIndPattern (VAR thePattern:\xDDPattern; 
                         patListID: Integer; index: Integer);

A Pattern record.
The resource ID for a resource of type 'PAT#'.
The index number for the desired pattern within the pattern list ('PAT#') resource.
In the parameter thePattern, the GetIndPattern procedure returns a Pattern record for a pattern stored in a pattern list ('PAT#') resource. Specify the resource ID for a pattern list ('PAT#') resource in the patListID parameter. In the index parameter, specify the index number to a particular pattern stored in that resource. The index number can range from 1 to the number of patterns in the pattern list resource. The GetIndPattern procedure calls the following Resource Manager function with these parameters:

GetResource('PAT ', patListID);
There is a pattern list resource in the System file that contains the standard Macintosh patterns used by MacPaint. Figure 3-28 shows these standard patterns. The resource ID, and the constant you can use to represent it, are

CONST sysPatListID = 0;
Figure 3-28 Standard patterns

The GetIndPattern procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.

The pattern list resource is described on page 3-137; the Pattern record is described on page 3-36. See the chapter "Resource Manager" in Inside Macintosh: More Macintosh Toolbox for more information about resources, the Resource Manager, and the GetResource function.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996