LinearIndicator

(Meter Parts Library)

Description: Will draw a linear type indicator. A linear indicator can be drawn in 3 different ways.  Scaled from min to current position, cropped from min to current position or as a line that moves to the current position. This function must be called inside a GUITransform to work properly.
Returns: Image handle
Usage: Steady State only.
Function Groups: Graphics
Related to:
Format: \MeterParts\LinearIndicator(DataSource, IndicatorImage, Orientation, DrawMode, IndicatorRToL, Hue, Saturation, Brightness, Transparency, Contrast, ColorizeHue, ColorizeIntensity, UseTagScaling, MinScaleValue, MaxScaleValue, DampenIndicator, NumberOfSteps)
Parameters:  
DataSource  
Required. A Tag name, constant or expression that provides the value to show.
IndicatorImage  
Required. The full path to the name of an image file to use as the indicator. Typically this is an image of a needle.
Orientation  
A flag indicating the orientation of the Indicator. Set to 0 for Horizontal and 1 for Vertical. The default is 0 (Horizontal).
DrawMode  
Controls how the indicator is drawn. Details of the 3 modes are as follows

DrawMode

Meaning

0

Scaled. This mode will scale the Indicator image from the 0 position to the position that represents the current value of the DataSource.

1

Cropped. This mode will scale the indicator image from the 0 position to the full position and then crop it to the position that represents the current value of the DataSource.

2

Moving   This mode will keep the Indicator image at a constant size and simply move it to the position that represents the current value of the DataSource.

IndicatorRToL  
A flag that changes the location of the 0 position. If set to true, the 0 position is on the right side or the top in vertical orientation.

If set to false and the 0 position is on the left side or the bottom in vertical orientation. The default is false.
Hue  
The hue translation to perform on the Indicator image. This enables you to change the color.
The image must have color in it already to perform a hue translation. If there is no color to start with, then changing this value does nothing. You can add color by setting a value for the ColorizeHue parameter, described later.
The default is 0, indicating that no hue translation is done and the indicator is in its native color.
Saturation  
The amount of saturation of the colors in the indicator image. A value of 0 will make the image black and white (no color saturation). A value of 2 produces a brightly colored (saturated) indicator. The default is 1 which corresponds to the native saturation of the indicator image.
Brightness  
An adjustment of the brightness of the indicator image. Higher numbers produce a brighter indicator image. A 0 produces a black image. The default is 1 which corresponds to the native brightness of the indicator image.
Transparency  
An adjustment of the opacity of the indicator where 1 means 100% opacity and 0 means %100 transparent. The default is 1.
Contrast  
An adjustment of the contrast of the colors in the indicator image. A value of 0 produces a flat looking image and a value of 2 gives a high contrast image. The default is 1 which corresponds to the native contrast of the indicator image.
ColorizeHue  
A value that works in conjunction with ColorizeIntensity. This is the hue of the color that is introduced by colorizing an image. Colorizing an image will introduce color into an image that previously was black and white or grayscale. The default value is 0.
ColorizeIntensity  
A value to define how much color to introduce into the image. The default is 0, meaning not to introduce any color at all into the image.
UseTagScaling  
A flag that indicates whether to use the supplied Tag’s scaling values. The default is false.
MinScaleValue  
The minimum scale value to use if the UseTagScaling flag is not true. The default is 0.
MaxScaleValue  
The maximum scale value to use if the UseTagScaling flag is not true. The default is 100.
DampenIndicator  
A flag to indicate whether to dampen the indicator movement. Dampened movement creates the effect of animating the indicator. The default is false.
Comments: This function must be called within a GUITransform statement in order for it to work correctly.
The size of the indicator image is scaled with respect to the original size of the image and the size of the transform. If you want a smaller indicator you can simply make a smaller transform.

Example:

  GUITransform(706, 212, 856, 192,
               1, 1, 1, 1, 1 { Scaling              },
               0, 0          { Movement             },
               1, 0          { Visibility, Reserved },
               0, 0, 0       { Selectability        },
               Variable("Code\MeterParts")\LinearIndicator(Invalid, 
        "Bitmaps\Meter Parts\Indicators\Linear\LIndicator2.png", 0, 
               2, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 100, 0, 0));