ImageEn, unit iexLayers

TIETextLayer

TIETextLayer


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.


Methods and Properties


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


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


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


Size and Position
  AspectRatioLocked
  AutoSize
  ClientAreaBox
  ConvXBmp2Scr
  ConvXScr2Bmp
  ConvYBmp2Scr
  ConvYScr2Bmp
  Height
  HorzMargin
  PosX
  PosY
  PreferredAspectRatio
  RestoreAspectRatio
  SizeToText
  VertMargin
  Width

 Unique to TIETextLayer


Demos


  Demos\LayerEditing\Layers_Text\TextLayers.dpr
  Demos\LayerEditing\Layers_TextOut\TextLayers.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();


See Also


- LayersAdd
- LayersInsert
- TIELayerKind
- MouseInteractLayers