Important: The information in this document is obsolete and should not be used for new development.
SetEntries
Sets a group of color table entries for the currentGDevicedata structure.
pascal void SetEntries ( short start, short count, cSpecArray aTable);
start- The index of the first entry to be changed.
count- The number of entries to be changed.
aTable- An array of
ColorSpecdata structures containing the colors to be used.DISCUSSION
TheSetEntriesfunction sets a group of color table entries for the currentGDevicedata structure, starting at a given position for the specified number of entries. Use theaTableparameter to directly specify acSpecArraystructure, not the beginning of a color table. TheColorSpec.valuefields of the entries must be in the logical range for the target device's assigned pixel depth. Thus, with a 4-bit pixel size, theColorSpec.valuefields should be in the range 1 to 15. With an 8-bit pixel size, the range is 0 to 255. Note that all values are zero-based; for example, to set three entries, pass 2 in the count parameter.
The
- WARNING
- Instead of using
SetEntries, you should use the Palette Manager functionSetEntryColorto allow your application to run in a multiscreen or multitasking environment.<8batcolor>s![]()
SetEntriespositional information works in logical space rather than in the actual memory space used by the hardware. Requesting a change at the fourth position in the color table may not modify the fourth color table entry in the hardware, but it does correctly change the color on the screen for any pixels with a value of 4 in the video card. TheSetEntriesmode characterized by a start position and a length is called sequence mode. In this case,SetEntriessequentially loads new colors into the hardware in the same order as they appear in theaTableparameter, copies theclientIDfields for changed color table entries from the currentGDevicedata structure'sgdIDfield, and ignores theColorSpec.valuefields.The other
SetEntriesmode is called index mode. It allows thecSpecArraystructure to specify where the data will be installed on an entry-by-entry basis. To use this mode, pass -1 for the start position, with a valid count and a pointer to thecSpecArraydata structure. Each entry is installed into the color table at the position specified by theColorSpec.valuefield of each entry in thecSpecArraydata structure. In the currentGDevicedata structure's color table, theColorSpec.valuefields of all changed entries are assigned theGDevicedata structure'sgdIDvalue.When the Color Manager changes color table entries, it invalidates all cached fonts, and changes the color tables's seed number so that the next drawing operation triggers the Color Manager to rebuild the inverse table. If any of the requested entries are protected or out of range, the Color Manager returns a protection error, and nothing happens. The Color Manager changes a reserved entry only if the current
gdIDfield of the currentGDevicedata structure matches the low byte of the intendedColorSpec.valuefield in the color table.