Retrieving Logical Palette ColorsFastgraph provides two functions, fg_getrgb() and fg_getdacs(), for retrieving colors from the active logical palette. The fg_getrgb() function retrieves the RGB components of the specified color. Its parameters are the same as fg_setrgb(), but the last three parameters must be passed by reference because they receive the requested color's RGB components. For example,
C/C++:
Delphi:
Visual Basic:
would store the RGB components for color 10 in the variables red, green, and blue. Each color component will be between 0 and 255. As you might expect, fg_getdacs() retrieves one or more consecutive colors from the active logical palette and uses the same parameters as fg_setdacs(). The following code will store the RGB components for the 236 non-system colors (colors 10 to 245) in the array RGBvalues:
C/C++:
Delphi:
Visual Basic:
As always, each color component will be between 0 and 255.
|
 
copyright 2001 Ted Gruber Software, Inc.