Important: The information in this document is obsolete and should not be used for new development.
GetSubTable
Used by system software to search one color table for the best matches to colors in another color table. You can use this function to determine the best indexes in the currentGDevicedata structure's CLUT for a set of colors in your application's color table.
pascal void GetSubTable ( CTabHandle myColors, short iTabRes, CTabHandle targetTbl);
myColors- A handle to a color table containing the colors for which you want matches.
iTabRes- The resolution of the inverse table to be used.
targetTbl- A handle to a color table whose colors are to be matched.
DISCUSSION
TheGetSubTablefunction searches one color table for the best matches to colors in another color table. Supply the colors you want matched in themyColorsparameter. Supply the color table to be searched in thetargetTblparameter.GetSubTablestores indexes from the color table intargetTblin thevaluefield of the color table in themyColorsparameter.The Color Manager uses the
Color2Indexfunction for eachRGBColordata structure in the color table of themyColorsparameter. It determines the best match in the target table and stores that index value in the color table of themyColorsparameter.If you supply
NULLfortargetTbl, then the Color Manager searches the currentGDevicedata structure's CLUT, and uses its inverse table. Otherwise a temporary inverse table is built, with a resolution of the value in theiTabResparameter.SPECIAL CONSIDERATIONS
Depending on the requested resolution, building the inverse table can require large amounts of temporary space in the application heap: twice the size of the table itself, plus a fixed overhead of 3-15 KB for each inverse table resolution.