Important: The information in this document is obsolete and should not be used for new development.
MyRecordColors
When you return thecolorBankIsCustom
constant in thecolorBankType
parameter to yourMyInitPickMethod
function (described in the preceding section), your color-picking method ('cpmt'
) resource must include a routine that creates this color bank; for example, your application may want to create a histogram with a resolution of 8 bits per color. Here is how you would declare this routine if it were a Pascal function namedMyRecordColors
:
FUNCTION MyRecordColors (dataRef: LongInt; colorsArray: RGBColorArray; colorCount: LongInt; VAR uniqueColors: LongInt): OSErr;
dataRef
- A handle to any data your method needs. Your application initially creates this handle using the
MyInitPickMethod
routine (explained in the preceding section).colorsArray
- An array of
RGBColor
records. (RGBColor
records are described in the chapter "Color QuickDraw" in this book.) YourMyRecordColors
routine should store the color information for this array ofRGBColor
records in a data structure of typeRGBColorArray
. You should define theRGBColorArray
data type as follows:TYPE RGBColorArray = ARRAY[0..0] OF RGBColor;
colorCount
The number of colors in the array specified in thecolorsArray
parameter.uniqueColors
- Upon input: the number of unique colors already added to the array in the
colorsArray
parameter. (The Picture Utilities functions call yourMyRecordColors
routine once for every color in the picture, pixel map, or bitmap.) YourMyRecordColors
routine must calculate the number of unique colors (to the resolution of the color bank) that are added by this call. YourMyRecordColors
routine should add this amount to the value passed upon input in this parameter and then return the sum in this parameter.DESCRIPTION
YourMyRecordColors
routine should store each color encountered in a picture or pixel into its own color bank. The Picture Utilities callMyRecordColors
only if yourMyInitPickMethod
routine returns the constantcolorBankIsCustom
in thecolorBankType
parameter. The Picture Utilities functions callMyRecordColors
for all the colors in the picture, pixel map, or bitmap. If yourMyRecordColors
routine generates any error, it should return the error as its function result.