Scale

_ScaleProperties, DefaultScalePosition, LockScale, ScaleProperties, ShowScale, ToggleScale

DefaultScalePosition

This function runs the Default Scale Position command.

Description 

 DefaultScalePosition();

Moves the scale bar into its default position.

LockScale

This function runs the Lock Scale command.

Description 

 LockScale(
   int  Enabled
);

Locks/unlocks the scale bar in its position.

Enabled 1 is locked.

Parameters

int Enabled

0

Disabled.

1

Enabled.

ScaleProperties

This function runs the Scale Properties command.

Interactive command to this function: View > Layers Properties > Scale Properties

Description 

 ScaleProperties(
   int  ScaleType,
   dword  ScaleColor,
   dword  ScaleBackground,
   double  LineWidth,
   double  GridDensity,
   int  AutoSize
);

This function sets the scale type, color, background, line width, grid density and autosize values.

Parameters

int ScaleType

Defines the scale type and can be one of the following:

0

Vertical

1

Horizontal

dword ScaleColor

Color as a 32bit unsigned integer (hexadecimal form: 0xffRRGGBB) or 0 for transparent.

dword ScaleBackground

Background color in the same form as the ScaleColor.

double LineWidth

Line width in pixels.

double GridDensity

Scale size in pixels (only in uncalibrated document).

int AutoSize

Grid density autosize.

0

Manual

1

Automatic

ScaleProperties(0, (255*256*256*256) + (256 * 255 *255), 0, 1, 10, 0); // red scale with transparent background
ShowScale

Description 

 ShowScale(
   int  ScaleVisible
);

This function shows or hides the scale.

Parameters

int ScaleVisible

Displays or hides Scale.

0, FALSE

Hides Scale.

1, TRUE

Displays Scale.

ToggleScale

This function runs the View > Layers > Scale command.

Description 

 ToggleScale();

This function displays/hides the scale layer.

_ScaleProperties

This function runs the View > Layers Properties > Scale Properties command.

Description 

 _ScaleProperties();

This function displays the Scale Properties dialog window.