ImageEn, unit iexLayers

TIELineLayer.LabelPosition

TIELineLayer.LabelPosition


Declaration

property LabelPosition: TIELineLabelPos;


Description

Specifies the position and visibility of the text label.
Value Description
ielpHide Does not show the text label even if text has been specified
ielpAtStart Shows the text label at the start of the line
ielpAtEnd Shows the text label at the end of the line
ielpAbove Shows the text above the line (without any border or background)
ielpBelow Shows the text below the line (without any border or background)
ielpAutoAbove Always shows the text above the line and automatically flips the text it is upright (i.e. it is above regardless of the rotation)
ielpAutoBelow Always shows the text below the line and automatically flips the text it is upright (i.e. it is below regardless of the rotation)

Default: ielpAtEnd


Examples

// Move the label to the start of the line
TIELineLayer( ImageEnView1.CurrentLayer ).LabelPosition := ielpAtStart;


// Add a ruler layer showing lengths in MM
ImageEnView1.LayersAdd( ielkLine , 100, 100, 250, 100 );
ImageEnView1.CurrentLayer.RulerMode  := iermLabel;
ImageEnView1.CurrentLayer.RulerUnits := ieuMillimeters;
TIELineLayer( ImageEnView1.CurrentLayer).LabelPosition := ielpAutoAbove;
TIELineLayer( ImageEnView1.CurrentLayer).StartShape := ieesBar;
TIELineLayer( ImageEnView1.CurrentLayer).EndShape := ieesBar;
ImageEnView1.Update();




// Add text label and an arrow
TIELineLayer( ImageEnView1.CurrentLayer ).LabelPosition := ielpAtEnd;
TIELineLayer( ImageEnView1.CurrentLayer ).StartShape := ieesArrow;
TIELineLayer( ImageEnView1.CurrentLayer ).Text := 'Test Label';
ImageEnView1.Update();




// Hide labels of all line layers when user clicks a check box
procedure Tfmain.chkShowLabelsClick(Sender: TObject);
var
  I: integer;
begin
  ImageEnView1.LockUpdate();
  for I := 0 to ImageEnView1.LayersCount - 1 do
    if ImageEnView1.Layers[ I ].Kind = ielkLine then
    begin
      if chkShowLabels.Checked then
        TIELineLayer( ImageEnView1.Layers[ I ]).LabelPosition := ielpAtEnd
      else
        TIELineLayer( ImageEnView1.Layers[ I ]).LabelPosition := ielpHide;
    end;
  ImageEnView1.UnlockUpdate();
end;


See Also

 LabelAlignment
 LabelFont
 LabelShape
 LabelText
 LabelHorzMargin
 LabelVertMargin
 StartShape
 EndShape