Declaration
property RulerMode: TIERulerMode;
Description
Allow the layer to measure or display the measurement of a distance or area.
For
TIELineLayer,
TIETextLayer or
TIEAngleLayer the measurement can be displayed as the layer text (iermLabel) or as a hover hint (iermHintOnly).
For other types it can only be displayed as a hover hint (iermHintOnly).
Note:
◼Use
RulerUnits to specify the display units
◼Use
MeasureDecimalPlaces to specify the number of decimal places
◼Unit text can be edited with
MeasureUnits
◼Use
TImageEnView.SetScale to adjust the scale of units
◼For
TIEImageLayer,
TIEPolylineLayer and
TIEShapeLayer the content of the layer is ignored, the area of the whole layer is returned
Line Layer Notes:
◼LabelText has no effect if
RulerMode = iermLabel
Text Layer Notes:
◼Text has no effect if
RulerMode = iermLabel
◼Rich Text formatting is not supported when
RulerMode = iermLabel
◼If
BorderShape = iesEllipse, it displays the area of an ellipse within the layer boundaries. In all other cases, it displays the whole area of the layer (i.e. as a rectangle)
Angle Layer Notes:
◼An angle label is displayed if RulerMode is iermLabel or iermNone. It is hidden for iermHintOnly
Default: iermNone
// Add a ruler layer showing lengths in CM (to one decimal place)
ImageEnView1.LayersAdd( ielkLine , 100, 100, 250, 250 );
ImageEnView1.CurrentLayer.RulerMode := iermLabel;
ImageEnView1.CurrentLayer.RulerUnits := ieuCentimeters;
IEGlobalSettings().MeasureDecimalPlaces := 1;
TIELineLayer( ImageEnView1.CurrentLayer).LabelPosition := ielpAutoAbove;
TIELineLayer( ImageEnView1.CurrentLayer).StartShape := ieesBar;
TIELineLayer( ImageEnView1.CurrentLayer).EndShape := ieesBar;
ImageEnView1.Update();
// Add a measure box layer showing rectangular area sizes in CM (to one decimal place)
ImageEnView1.LayersAdd( ielkText , 100, 100, 250, 250 );
ImageEnView1.CurrentLayer.RulerMode := iermLabel;
ImageEnView1.CurrentLayer.RulerUnits := ieuCentimeters;
IEGlobalSettings().MeasureDecimalPlaces := 1;
ImageEnView1.Update();
// Add a measure box layer showing elliptical area sizes in inches
ImageEnView1.LayersAdd( ielkText , 100, 100, 250, 250 );
ImageEnView1.CurrentLayer.RulerMode := iermLabel;
ImageEnView1.CurrentLayer.RulerUnits := ieuInches;
TIETextLayer( ImageEnView1.CurrentLayer).BorderShape := iesEllipse;
ImageEnView1.Update();
// Hide the displayed angle for an angle layer (only shown as a hint)
if ImageEnView1.CurrentLayer.Kind = ielkAngle then
ImageEnView1.CurrentLayer.RulerMode := iermHintOnly;
See Also
◼MeasureDecimalPlaces
◼MeasureUnits
◼RulerUnits
◼RulerValue
◼SetScale
◼Dpi