ImageEn, unit imageenview

TImageEnView.OnMeasure

TImageEnView.OnMeasure


Declaration

property OnMeasure: TIEMeasureEvent;


Description

Occurs whenever the user is measuring using miMeasureLength, miMeasureRect, miMeasurePath or miMeasureEllipse.
It is useful to assign styling to the ruler layer, or to display the current measurement value.

Parameter Description
Sender The TImageEnView control
MeasureType What is being measured, e.g. iemLength or iemRectArea, iemEllipseArea
MeasureLayer The layer that displays the measurement. Will be a TIELineLayer if MeasureLayer = iemLength, TIEPolylineLayer for MeasureLayer = iemPath, TIEAngleLayer for MeasureLayer = iemAngle, or TIETextLayer for iemRectArea or iemEllipseArea
Value The current value of the measurement (e.g. the length of the line or area of the ellipse)
Units The current units of the measurement. This value can be modified


Example

procedure Tfmain.ImageEnView1Measure(Sender: TObject; MeasureType: TIEMeasureType; MeasureLayer: TIELayer; Len: Double; var Units: TIEUnits);
begin
  // MEASURE LENGTHS
  if MeasureLayer is TIELineLayer then
    with TIELineLayer( MeasureLayer ) do
    begin
      LineColor := clWhite;
      LineWidth := 3;
      LabelFont.Color := clBlue;
    end
  else
  // MEASURE AREAS
  if MeasureLayer is TIETextLayer then
    with TIETextLayer( MeasureLayer ) do
    begin
      BorderColor  := clBlack;
      BorderWidth  := 3;
      FillColor    := clSilver;
      Font.Color   := clBlue;
      Transparency := 128;
    end;
end;


See Also

MouseInteractGeneral
SetScale