ImageEn, unit iexLayers

TIETextLayer.Alignment

TIETextLayer.Alignment


Declaration

property Alignment: TIEAlignment;


Description

Specifies the text alignment.

Note:
iejJustify is unsupported for TIETextLayers
iejCenter is recommended when BorderShape is not iesRectangle or iesRoundRect

Note: This property is not used if rich text formatting is enabled

Default: iejLeft


Examples

// Center the text for the current text layer
TIETextLayer( ImageEnView1.CurrentLayer ).Alignment := iejCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).Layout := ielCenter;
ImageEnView1.Update();


// Add a "Shape" layer with margins around text
ImageEnView1.LayersAdd( ielkText );
TIETextLayer( ImageEnView1.CurrentLayer ).Text         := 'EXPLOSION!';
TIETextLayer( ImageEnView1.CurrentLayer ).Font.Style   := [fsBold];
TIETextLayer( ImageEnView1.CurrentLayer ).BorderShape  := iesExplosion;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderColor  := clBlack;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderWidth  := 1;
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor    := clRed;
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor2   := clYellow;
TIETextLayer( ImageEnView1.CurrentLayer ).FillGradient := gpgVertCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).Alignment    := iejCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).Layout       := ielCenter;
TIETextLayer( ImageEnView1.CurrentLayer ).HorzMargin   := 0.15;
TIETextLayer( ImageEnView1.CurrentLayer ).VertMargin   := 0.25;
TIETextLayer( ImageEnView1.CurrentLayer ).SizeToText();
ImageEnView1.Update();




// Add a "Shape" layer with vertically offset text
ImageEnView1.LayersAdd( ielkText, 200, 200, 230, 200 );
ImageEnView1.CurrentLayer.AspectRatioLocked            := True;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderShape  := iesHeart;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderWidth  := 0;
TIETextLayer( ImageEnView1.CurrentLayer ).BorderColor  := clNone;
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor    := $004646FF;
TIETextLayer( ImageEnView1.CurrentLayer ).Font.Style   := [fsBold];
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    := 22;
TIETextLayer( ImageEnView1.CurrentLayer ).TextOverflow := ieoShrink;
TIETextLayer( ImageEnView1.CurrentLayer ).TextOffsetY  := -0.15;
ImageEnView1.LayersTextRotateMode                      := iermBoth;
ImageEnView1.Update();




See Also

Layout
TextOffsetX