Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!reed!maclab From: maclab@reed.UUCP (Mac DLab) Newsgroups: net.micro.mac Subject: Re: Accessing patterns? Message-ID: <2345@reed.UUCP> Date: Mon, 20-Jan-86 12:40:32 EST Article-I.D.: reed.2345 Posted: Mon Jan 20 12:40:32 1986 Date-Received: Wed, 22-Jan-86 05:17:08 EST References: <97200001@siemens.UUCP> Organization: Reed College, Portland, Oregon Lines: 38 > > I'm trying to get patterns from the standard system pattern list (not the 5 > fill shades, but the 38 ones used in MacPaint) in a Megamax C program. > There is a nice function to do this in Pascal called 'GetIndPattern' but it > doesn't seem to exist in C. These patterns are in a list in the system > resource file of type 'PAT#' - does anyone know how to access them > individually? Any suggestions would be appreciated! > > Thanks - Alex Rehak > {allegra,ihnp4,princeton,astrovax}!siemens!rehak > or call > (609)734-6555 Here is source for the Rascal 'GetIndPattern' -- ------------------------------------ PROCEDURE GetIndPattern( thePat: ^Pattern; patListID: INTEGER; index: INTEGER); Type PatList = Record Num: Integer; Pats: Pattern[1]; (* actually, a variable length array *) End; PatLHand = ^^PatList; Var Hand: PatLHand; { Hand := GetResource(ptrL(" PAT#"+2)^,patListID); If (!Hand) or (index > Hand^^.Num) or (index=<0) then return; thePat^ := Hand^^.Pats[--index]; }; ------------------------------------ Scott Gillespie