[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Graphics' (#lcl)

TCanvas.TextRect

Writes Text string within a specified rectangle, according to predefined Style

Declaration

Source position: graphics.pp line 1210

public procedure TCanvas.TextRect(

  const ARect: TRect;

  X: Integer;

  Y: Integer;

  const Text: string

);

procedure TCanvas.TextRect(

  ARect: TRect;

  X: Integer;

  Y: Integer;

  const Text: string;

  const Style: TTextStyle

); virtual;

Arguments

ARect

  

Rectangle within which the specified text is drawn

X

  

Horizontal text start (respected only if TextStyle.Alignment = taLeftJustify)

Y

  

Vertical position of the top of the text (respected only if TextStyle.Layout = tlTop)

Text

  

Text to be drawn

Arguments

ARect

  

Rectangle within which the specified text is drawn

X

  

Horizontal text start (respected only if TextStyle.Alignment = taLeftJustify)

Y

  

Vertical position of the top of the text (respected only if TextStyle.Layout = tlTop)

Text

  

Text to be drawn

Style

  

Optional parameter which determines whether the text is justified, word-wrapped, clipped, etc. If omitted, the current TextStyle of the canvas is used.

Description

Writes Text string within a specified rectangle, according to predefined Style

The boundaries of the rectangle are specified in ARect

X, Y define the starting point for writing the Text within the rectangle.

TextStyle determines whether the text is justified, centered, word-wrapped, clipped at the rectangle boundaries, etc. If the Style argument is omitted, defaults are assumed.

Note: The exact text position depends on the specified rectangle, the TextStyle of the canvas, and the X, Y coordinates:

The latest version of this document can be found at lazarus-ccr.sourceforge.net.