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 currentGDevice
data 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
TheGetSubTable
function searches one color table for the best matches to colors in another color table. Supply the colors you want matched in themyColors
parameter. Supply the color table to be searched in thetargetTbl
parameter.GetSubTable
stores indexes from the color table intargetTbl
in thevalue
field of the color table in themyColors
parameter.The Color Manager uses the
Color2Index
function for eachRGBColor
data structure in the color table of themyColors
parameter. It determines the best match in the target table and stores that index value in the color table of themyColors
parameter.If you supply
NULL
fortargetTbl
, then the Color Manager searches the currentGDevice
data structure's CLUT, and uses its inverse table. Otherwise a temporary inverse table is built, with a resolution of the value in theiTabRes
parameter.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.