DrawScale

(Meter Parts Library)

Description: Will draw a scale (i.e. tick marks) for a linear or radial type meter. These marks are images (normally lines) indicating the major and minor divisions of the entire scale. This function must be called inside a GUITransform to work properly.
Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to:  
Format: \MeterParts\DrawScale(MajorTickImage, MinorTickImage, MajorDivisions, MinorDivisions, RelativeSize, LinearScale, Orientation, MinAngle, MaxAngle, Hue, Saturation, Brightness, Transparency, Contrast, ColorizeHue, ColorizeIntensity)
Parameters:  
MajorTickImage   
Required. The full path to an image file to use as a major tick mark.
MinorTickImage   
Required. The full path to an image file to use as a minor tick mark.
MajorDivisions   
Optional. The number of major divisions in the scale. The default is 1 major division.
MinorDivisions   
Optional. The number of Minor divisions between the major divisions in the scale. The default is 5 minor divisions.
RelativeSize   
Optional. The relative size of the tick marks. If set, the tick marks will resize independently from the automatic sizing that is done when you resize the transform. Typically the range for this parameter is from 0 to 2, where 2 is double the default size and 0.5 is half the default size. The default is 1 which is the native size as scaled with the transform size.
LinearScale   
Optional. A flag that, when set to true causes a linear scale to be drawn. When set to false, a Radial scale will be created. The default is true.
Orientation   
Optional. A flag that is relevant only when drawing a linear type scale. When set to true the scale will be oriented vertically. When set to false, the scale will be oriented horizontally. The default is false.
MinAngle   
Optional. The angle for the starting position of a radial type scale. 0 is defined as up or the 12 o’clock position. This parameter is relevant only when drawing a radial type scale. The default is 0.
MaxAngle   
Optional. The angle for the ending position of a Radial type scale. . 0 is defined as up or the 12 o’clock position. This parameter is relevant only when drawing a radial type scale. The default is 90.
Hue   
Optional. The Hue translation to perform on the tick mark image. 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   
Optional. The amount of saturation of the colors in the tick mark 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   
Optional. An adjustment of the brightness of the tick mark image. Higher numbers produce a brighter image. A 0 produces a black image. The default is 1 which corresponds to the native brightness of the tick mark image.
Transparency   
Optional. An adjustment of the opacity of the tick mark image where 1 means 100% opacity and 0 means %100 transparent. The default is 1.
Contrast   
Optional. An adjustment of the contrast of the colors in the tick mark 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 image.
ColorizeHue   
Optional. 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   
Optional. 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.
Comments: This function must be called from within a GUITransform statement in order for it to work correctly.
The Tick Marks are scaled according to the size of the transform and the RelativeSize parameter.

Example:

  GUITransform(674, 284, 824, 134,
               1, 1, 1, 1, 1 { Scaling              },
               0, 0          { Movement             },
               1, 0          { Visibility, Reserved },
               0, 0, 0       { Selectability        },
               Variable("Code\MeterParts")\DrawScale("Bitmaps\Meter Parts\Tick Marks\Large_Thin.png",
               "Bitmaps\Meter Parts\Tick Marks\Small_Thin.png",
               1, 5, 1, 1, 0, 0, 90, 0, 1, 1, 1, 1, 0, 0));