ImageEn, unit iexLayers




property RulerMode: TIERulerMode;


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).

Value Description
iermNone The layer is not used to display a measurement
iermHintOnly Same as iermNone, except that the hover hint when creating or sizing a shows layer its current length (TIELineLayer, TIEPolylineLayer), area (TIETextLayer) or angle (TIEAngleLayer)
iermLabel The label of the layer will display the current length (TIELineLayer), area (TIETextLayer) or angle (TIEAngleLayer). Unsupported for TIEImageLayer, TIEPolylineLayer and TIEShapeLayer

Layer Type iermHintOnly iermLabel
TIELineLayer Line length shown as hover hint Line length shown as label
TIEPolylineLayer Polyline length and polygon area are shown as hover hint Unsupported
TIETextLayer Area and perimeter of layer or elliptical region shown as hover hint Area of layer or elliptical region shown as text
TIEAngleLayer Angle shown as hover hint Angle shown as label
TIEImageLayer Area of whole layer shown as hover hint Unsupported
TIEShapeLayer Area of the whole layer shown as hover hint (treated as a rectangle, shape is ignored) Unsupported

- 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;

// 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;

// 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;

// 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