ImageEn, unit iexLayers

TIELayerKind


Declaration

TIELayerKind = (ielkImage, ielkShape, ielkLine, ielkPolyline, ielkText, ielkAngle);


Description

Returns the type of a TIELayer.
Kind Class Description
ielkImage TIEImageLayer Layer that contains an image
ielkShape TIEShapeLayer Layer that displays standard shapes (rectangles, ellipses, stars, etc)
ielkLine TIELineLayer Layer that displays a single line, optionally including a text label and start and ending arrows
ielkPolyline TIEPolylineLayer Layer that displays a polyline or polygon of multiple points
ielkAngle TIEAngleLayer Layer that displays an angle
ielkText TIETextLayer Layer that displays text


Example 1

if ImageEnView1.CurrentLayer.Kind = ielkImage then
  TIEImageLayer( ImageEnView1.CurrentLayer ).ResampleFilter := rfLanczos3;

// Which is the same as...
if ImageEnView1.CurrentLayer is TIEImageLayer then
  TIEImageLayer( ImageEnView1.CurrentLayer ).ResampleFilter := rfLanczos3;


Example 2

// Hide labels of all line layers when user clicks a check box
procedure Tfmain.chkShowLabelsClick(Sender: TObject);
var
  I: integer;
begin
  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.Update();
end;