The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information.... |
Home ![]() ![]() ![]() |
|
Using TColorScale |
|
The TColorScale component is intended to display color coded scales as they are used, for example, in geographic maps for the indication of the altitude. The basic idea of TColorScale is to use an array of colors and map it on a range of numbers. Thus each number gets a color assigned and vice versa. The color array contains, by default, 1024 colors and can be accessed via the ColorArray property and its associated properties and methods. The mapping of the colors to the numeric scale is controlled by the properties ColorLow and ColorHigh, the boundaries of the scale are specified by the properties ScaleRangeHigh and ScaleRangeLow:
The color scale may be either horizontal or vertical, depending on the property Orientation.
When the mouse is over the color scale the OnMouseMoveInScale event is triggered. Further, there are two functions which allow to translate a numeric value into the corresponding color and vice versa: ValueToColor and ColorToValue. The back transformation of a color into a numeric value may not be unique. In this case, the lowest possible value is returned by the function ColorToValue.
|