ImageEn, unit iexLayers

TIETextLayer.SizeToText

TIETextLayer.SizeToText


Declaration

 procedure TIETextLayer.SizeToText(EnlargeOnly: Boolean = False);


Description

Updates the size of the layer to fit the displayed text.
If EnlargeOnly is true, the layer will not be reduced in size to fit the text more tightly, only enlarged to ensure all text is visible.


Example

// 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;


See Also

 AutoSize
 TextOverflow