ImageEn, unit iexLayers

TIEPolylineLayer

TIEPolylineLayer


Description


TImageEnView supports multiple layers, allowing the creation of a single image from multiple source images (which can be resized, rotated, moved, etc).
TIEPolylineLayer is a descendent of TIELayer that displays a line formed from multiple points. It can also be closed to display a polygon.



You can create polyline layers with code using LayersAdd or by user action by setting MouseInteractLayers:

Item Description
mlClickCreatePolylineLayers Click multiple points to create a polyline layer
mlDrawCreatePolylineLayers Click and drag to freehand draw a polyline layer
mlEditLayerPoints Click and drag points to move them. Click on the polyline to add a point, Alt key to convert a point to a curve, Ctrl+click or delete key to remove a point
mlCreatePolylineLayers Drag the area of a polyline layer (must use code to add points)

* Auto-closing of the polyline layer is controlled by LayersAutoClosePolylines.

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


Examples


// Draw a triangle polygon
With TIEPolylineLayer( ImageEnView1.CurrentLayer ) do
begin
  ClearAllPoints();
  AddPoint( 500, 0 );
  AddPoint( 1000, 1000 );
  AddPoint( 0, 1000 );
  PolylineClosed := True;
end;
ImageEnView1.Update();

// Which is the same as..
var
  shapePoints: array of TPoint;
begin
  SetLength( shapePoints, 3 );
  shapePoints[0] := Point( 500, 0 );
  shapePoints[1] := Point( 1000, 1000 );
  shapePoints[2] := Point( 0, 1000 );
  TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( shapePoints, True );
  ImageEnView1.Update();
end;

// Which is the same as...
TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( [ Point(500, 0), Point(1000, 1000), Point(0, 1000) ], True );
ImageEnView1.Update();

// Which is the same as...
TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( iesTriangle, True );
ImageEnView1.Update();




// If PolylineClosed is not enabled, we get a polyline, instead of a polygon
TIEPolylineLayer( ImageEnView1.CurrentLayer ).PolylineClosed := False;
ImageEnView1.Update();




// Allow users to create and edit a polygon
ImageEnView1.LayersAutoClosePolylines := iecmAlways;
ImageEnView1.MouseInteractLayers := [ mlClickCreatePolylineLayers, mlEditLayerPoints ];

// Allow users to freehand draw a polyline
ImageEnView1.MouseInteractLayers := [ mlDrawCreatePolylineLayers, mlEditLayerPoints ];

// Allow users to create and edit a polyline
ImageEnView1.LayersAutoClosePolylines := iecmManual;
ImageEnView1.MouseInteractLayers := [ mlClickCreatePolylineLayers, mlEditLayerPoints ];



Hold Alt to convert a line to a curve...




Methods and Properties


General
  Assign
  ConvertToImageLayer
  CopyToBitmap
  DrawingInfo
  DrawOuter
  DrawToCanvas
  GetProperties
  Guid
  GroupIndex
  IsMask
  Kind
  LayerIndex
  Locked
  MaskInverted
  Modified
  Name
  Selectable
  Selected
  SetProperties
  Swap
  SupportsFeature
  Tag
  UserData
  UserDataLen
  Visible
  VisibleBox


Polygon Points
  AddCurvePoints
  AddPoint
  ClearAllPoints
  GetPointEx
  InsertCurvePoints
  InsertPoint
  PolylineClosed
  Points
  PointCount
  RemovePoint
  SetPoint
  SetPoints
  SimplifyPolygon
  SmoothJaggedEdges


Style
  AntiAlias
  AlphaEdgeFeathering
  Cropped
  FillColor
  FillColor2
  FillGradient
  FillOpacity
  LineColor
  LineWidth
  Opacity
  Operation
  Rotate
  SoftShadow


Size and Position
  AspectRatioLocked
  AutoSize
  CalculateArea
  CalculateCentroid
  CalculateLength
  ClientAreaBox
  ConvXBmp2Scr
  ConvXScr2Bmp
  ConvYBmp2Scr
  ConvYScr2Bmp
  Height
  PosX
  PosY
  PreferredAspectRatio
  RestoreAspectRatio
  Width

 Unique to TIEPolylineLayer



See Also


- LayersAdd
- LayersInsert
- TIELayerKind
- MouseInteractLayers