ImageEn, unit iexLayers

TIETextLayer


Declaration

TIETextLayer = 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).
TIETextLayer is a descendent of TIELayer that displays text. Rich text is supported if EnableFormatting is true.



You can text image layers with code using LayersAdd or by user action by setting MouseInteractLayers to mlCreateTextLayers.

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


Demos

Demo Description Demo Project Folder Compiled Demo
Text Layers Adding and editing text layers, including rich formatting \Demos\LayerEditing\Layers_Text\TextLayers.dpr   
Adding Text to Images Draw text onto images using text layers \Demos\LayerEditing\Layers_TextOut\TextLayers.dpr   
All Layer Editing Usage of image, shape, text and line layers \Demos\LayerEditing\Layers_AllTypes\Layers.dpr   
Stamp Layers Add text, shapes, images and arrows directly to an image by clicking and dragging \Demos\LayerEditing\StampTextAndShapes\StampLayers.dpr   


Examples

// Append a text layer
ImageEnView1.LayersAdd( ielkText );
TIETextLayer( ImageEnView1.CurrentLayer ).Text := 'This is a Text Layer';
TIETextLayer( ImageEnView1.CurrentLayer ).BorderColor := clBlack;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderWidth := 1;
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor := clWhite;
ImageEnView1.Update();



// Apply a "Paid" stamp to image
with ImageEnView1 do
begin
  LayersAdd( 'PAID', 42, clRed, 'Arial Black', [fsBold] );
  CurrentLayer.Rotate := 30;
  TIETextLayer( CurrentLayer ).SizeToText();
  CurrentLayer.PosX := IELayer_Pos_HCenter;
  CurrentLayer.PosY := IELayer_Pos_VCenter;
  LayersMergeAll();
end;

// Allow users to create and edit text layers
IEGlobalSettings().DefaultLayerText := 'Double-click to edit text';
ImageEnView1.MouseInteractLayers := [ mlCreateTextLayers, mlMoveLayers, mlResizeLayers ];

// Add a "Shape" layer with text
ImageEnView1.LayersAdd( ielkText, 800, 300, 400, 400 );
ImageEnView1.CurrentLayer.AspectRatioLocked := true;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderShape := iesHeart;
TIETextLayer( ImageEnView1.CurrentLayer ).Alignment := iejCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).Layout := ielCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).WordWrap := False;
TIETextLayer( ImageEnView1.CurrentLayer ).Text := 'I Heart Delphi';
TIETextLayer( ImageEnView1.CurrentLayer ).Font.Size := 42;
TIETextLayer( ImageEnView1.CurrentLayer ).TextOverflow := ieoShrink;
TIETextLayer( ImageEnView1.CurrentLayer ).HorzMargin := 0.30;
ImageEnView1.CurrentLayer.BorderColor := clBlack;
ImageEnView1.CurrentLayer.FillColor := clRed;
ImageEnView1.LayersTextRotateMode := iermBoth;
ImageEnView1.Update();



Methods and Properties

General
Public Method  Assign
Public Method  ConvertToImageLayer
Public Method  CopyToBitmap
Public Property  DrawingInfo
Public Property  DrawOuter
Public Method  DrawToCanvas
Public Method  GetProperties
Public Property  Guid
Public Property  GroupIndex
Public Property  IsMask
Public Property  Kind
Public Property  LayerIndex
Public Property  Locked
Public Property  MaskInverted
Public Property  Modified
Public Property  Name
Public Property  IsRuler
Public Property  RulerUnits
Public Property  RulerValue
Public Property  Selectable
Public Property  Selected
Public Method  SetProperties
Public Method  SetTextProperties
Public Method  Swap
Public Method  SupportsFeature
Public Property  Tag
Public Property  UserData
Public Property  UserDataLen
Public Property  Visible
Public Property  VisibleBox

Text Editing
Public Method  ActivateEditor
Public Property  Alignment
Public Property  EnableFormatting
Public Property  Font
Public Property  Layout
Public Method  LoadTextFromFile
Public Property  ReadOnly
Public Property  RichText
Public Property  Text
Public Property  TextOverflow
Public Property  WordWrap

Style
Public Property  AntiAlias
Public Property  AlphaEdgeFeathering
Public Property  BorderColor
Public Property  BorderWidth
Public Property  BorderRotate
Public Property  BorderShape
Public Property  Cropped
Public Property  FillColor
Public Property  FillColor2
Public Property  FillGradient
Public Property  FillOpacity
Public Property  Flip
Public Property  InnerGlow
Public Property  Opacity
Public Property  Operation
Public Property  Rotate
Public Property  SoftShadow

Size and Position
Public Property  AspectRatioLocked
Public Property  AutoSize
Public Property  ClientAreaBox
Public Method  ConvXBmp2Scr
Public Method  ConvXScr2Bmp
Public Method  ConvYBmp2Scr
Public Method  ConvYScr2Bmp
Public Property  Height
Public Method  HorzMargin
Public Property  PosX
Public Property  PosY
Public Method  PreferredAspectRatio
Public Method  RestoreAspectRatio
Public Method  SizeToText
Public Method  TextOffsetX
Public Method  TextOffsetY
Public Method  VertMargin
Public Property  Width

 Unique to TIETextLayer



See Also

- LayersAdd
- LayersInsert
- TIELayerKind
- MouseInteractLayers