TIETextLayer.FillGradient
Declaration
property FillGradient: TIEGDIPlusGradient;
Description
The direction of the gradient used for the text box fill.
If
FillColor is different from
FillColor2 the text box is filled with a gradient.
FillGradient specifies the direction.
To disable the gradient set the
FillColor2 to clNone, or
FillGradient to gpgNone.
Default: gpgVertical
// Add a red/blue horizontal gradient
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor := clRed;
TIETextLayer( ImageEnView1.CurrentLayer ).FillColor2 := clBlue;
TIETextLayer( ImageEnView1.CurrentLayer ).FillGradient := gpgHorizontal;
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();
Compatibility Information
Prior to v10.0.0, Layer Gradients were of type
TIELayerGradient. All gradients are now type
TIEGDIPlusGradient.
Conversions are as follows: grdNone -> gpgNone, grdHorizontal -> gpgHorizontal, grdVertical -> gpgVertical, grdHorzCenter -> gpgHorzCenter, grdVertCenter -> gpgVertCenter, grdDiagonal -> gpgDiagonal, grdDiagonal2 -> gpgDiagonal2, grdDiagCentered -> gpgDiagCenter, grdDiagCentered2 -> gpgDiagCenter2
Note: Items of
TIEGDIPlusGradient do not have the same indexes as
TIELayerGradient.
// cmbGradient contains items: None, Horizontal, Vertical, Horz Center...
// <= v9.3.1
if cmbGradient.ItemIndex = 0 then
lyr.FillGradient := gpgNone
else
lyr.FillGradient := TIELayerGradient( cmbGradient.ItemIndex - 1 );
// v10.0.0
lyr.FillGradient := TIEGDIPlusGradient( cmbGradient.ItemIndex );
See Also
◼TIELayer.FillGradient
◼FillColor
◼FillColor2
◼FillOpacity