ImageEn, unit iexLayers

TIELineLayer


Declaration

TIELineLayer = class(TIELayer);


Description

TImageEnView supports multiple layers, allowing the creation of a single image from multiple source images (which can be resized, rotated, moved, etc).
TIELineLayer is a descendent of TIELayer that displays a single line. It can optionally display a text label and starting and ending arrows.



You can create line layers with code using LayersAdd or by user action by setting MouseInteractLayers:
Item Description
mlClickCreateLineLayers Click start and end points to draw out a line layer
mlEditLayerPoints Click and drag points to move them. Hold Alt key, then click and drag to convert line to a curve
mlCreateLineLayers Drag the area of a line layer

Review the Layer Documentation for a full description of layer support.


Demos

Demo Description Demo Project Folder Compiled Demo
Line Layer Editing Creating and point editing line, poly-line and angle layers LayerEditing\Layers_Lines\Layers.dpr   
All Layer Editing Usage of image, shape, text, polygon and line layers LayerEditing\Layers_AllTypes\Layers.dpr   
Stamp Layers Add text, shapes, images and arrows directly to an image by clicking and dragging LayerEditing\StampTextAndShapes\StampLayers.dpr   


Examples

// Add a layer with yellow filled arrows and circle ends
ImageEnView1.LayersAdd( ielkLine );
TIELineLayer( ImageEnView1.CurrentLayer ).StartShape := ieesArrow;
TIELineLayer( ImageEnView1.CurrentLayer ).EndShape := ieesCircle;
TIELineLayer( ImageEnView1.CurrentLayer ).FillColor := clYellow;
TIELineLayer( ImageEnView1.CurrentLayer ).ShapeSize := 25;
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;

// Allow users to create and edit line layers
ImageEnView1.MouseInteractLayers := [ mlClickCreateLineLayers, mlEditLayerPoints ];


// Draw a Smiley Face

// make layer lines thicker
ImageEnView1.LayerDefaults.Values[ IELP_BorderWidth ] := '10';
ImageEnView1.LayerDefaults.Values[ IELP_FillColor ]   := 'clWhite';

// LEFT EYE
// Add an ellipse shape layer
ImageEnView1.LayersAdd( iesEllipse, 100, 100, 30, 30 );

// RIGHT EYE
// Add an ellipse shape layer
ImageEnView1.LayersAdd( iesEllipse, 170, 100, 30, 30 );

// SMILE
// Add a line layer
ImageEnView1.LayersAdd( Point( 100, 150 ), Point( 200, 150 ));

// Curve it
TIELineLayer(ImageEnView1.CurrentLayer).Curve := 1;

// Show changes
ImageEnView1.Update();





Methods and Properties

General
Public Method  ActivateEditor
Public Method  Assign
Public Method  ConvertToImageLayer
Public Method  ConvertToPolylineLayer
Public Method  CopyToBitmap
Public Property  DrawingInfo
Public Property  DrawOuter
Public Method  DrawToCanvas
Public Method  GetProperties
Public Property  Guid
Public Property  GroupIndex
Public Property  Hint
Public Property  IsMask
Public Property  Kind
Public Property  LayerIndex
Public Property  Locked
Public Property  MaskInverted
Public Property  Modified
Public Property  ModifiedDate
Public Property  Name
Public Property  ReadOnly
Public Property  Selectable
Public Property  Selected
Public Method  SetProperties
Public Method  SetTextProperties
Public Method  SupportsFeature
Public Property  Tag
Public Property  URL
Public Property  UserData
Public Property  UserDataLen
Public Property  Visible
Public Property  VisibleBox

Style
Public Property  AntiAlias
Public Property  AlphaEdgeFeathering
Public Property  Cropped
Public Property  Curve
Public Property  EndShape
Public Property  FillColor
Public Property  FillOpacity
Public Property  Flip
Public Property  InnerGlow
Public Property  LabelAlignment
Public Property  LabelBorderColor
Public Property  LabelBorderWidth
Public Property  LabelFillColor
Public Property  LabelFillColor2
Public Property  LabelFillGradient
Public Property  LabelFont
Public Property  LabelPosition
Public Property  LabelShape
Public Property  LabelText
Public Property  LabelTextStyling
Public Property  LineColor
Public Property  LineLength
Public Property  LinePoint1
Public Property  LinePoint2
Public Property  LineWidth
Public Property  LineStyle
Public Property  Opacity
Public Property  Operation
Public Property  Rotate
Public Property  ScaleLocking
Public Property  ShapeSize
Public Property  SoftShadow
Public Property  StartShape
Public Property  TextOverflow

Size and Position
Public Property  AspectRatioLocked
Public Property  ClientAreaBox
Public Method  ConvXBmp2Scr
Public Method  ConvXScr2Bmp
Public Method  ConvYBmp2Scr
Public Method  ConvYScr2Bmp
Public Method  GetPoints
Public Property  Height
Public Property  LabelHorzMargin
Public Property  LabelVertMargin
Public Property  PosX
Public Property  PosY
Public Method  PreferredAspectRatio
Public Method  RestoreAspectRatio
Public Method  SetPoints
Public Property  Width

Measurement
Public Property  RulerMode
Public Property  RulerUnits
Public Method  RulerValue

 Unique to TIELineLayer



See Also

 Layer Editing Overview
 LayersAdd
 LayersInsert
 MouseInteractLayers
 AdvancedDrawLine