Important: The information in this document is obsolete and should not be used for new development.
MyRecordColors
When you return thecolorBankIsCustomconstant in thecolorBankTypeparameter to yourMyInitPickMethodfunction (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
MyInitPickMethodroutine (explained in the preceding section).colorsArray- An array of
RGBColorrecords. (RGBColorrecords are described in the chapter "Color QuickDraw" in this book.) YourMyRecordColorsroutine should store the color information for this array ofRGBColorrecords in a data structure of typeRGBColorArray. You should define theRGBColorArraydata type as follows:TYPE RGBColorArray = ARRAY[0..0] OF RGBColor;
colorCount
The number of colors in the array specified in thecolorsArrayparameter.uniqueColors- Upon input: the number of unique colors already added to the array in the
colorsArrayparameter. (The Picture Utilities functions call yourMyRecordColorsroutine once for every color in the picture, pixel map, or bitmap.) YourMyRecordColorsroutine must calculate the number of unique colors (to the resolution of the color bank) that are added by this call. YourMyRecordColorsroutine should add this amount to the value passed upon input in this parameter and then return the sum in this parameter.DESCRIPTION
YourMyRecordColorsroutine should store each color encountered in a picture or pixel into its own color bank. The Picture Utilities callMyRecordColorsonly if yourMyInitPickMethodroutine returns the constantcolorBankIsCustomin thecolorBankTypeparameter. The Picture Utilities functions callMyRecordColorsfor all the colors in the picture, pixel map, or bitmap. If yourMyRecordColorsroutine generates any error, it should return the error as its function result.