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

TCanvas.TextOut

Writes text at the specified position on the canvas.

Declaration

Source position: graphics.pp line 1163

public procedure TCanvas.TextOut(

  X: Integer;

  Y: Integer;

  const Text: string

); virtual;

Arguments

X

  

Horizontal canvas coordinate where the text is written.

Y

  

Vertical canvas coordinate where the text is written.

Text

  

Values written in the text output operation.

Description

Writes the value in Text at the given X, Y coordinates on the canvas.

Calls Changing to signal the OnChanging event handler (when assigned). Calls RequiredState to ensure that handles for the canvas, Font, and Brush are valid.

Properties in TextStyle are converted and combined into the numeric flag used to format the Text, including Opaque and RightToLeft. Uses ExtUTF8Out to write to the device context using the position and style flags needed.

The Pen is positioned at the end of the Text when the output operation is completed. The vertical canvas coordinate is not altered in the method. In other words, TextOut does not handle multi-line text or word wrapping of the value in Text.

TextOut calls Changed to signal the OnChange event handler (when assigned).

See also

TCanvas.Changing

  

Signals the OnChanging event handler (when assigned).

TCanvas.OnChanging

  

Event handler signalled prior to changing the canvas.

TCanvas.Changed

  

Signals the OnChange event handler (when assigned).

TCanvas.OnChange

  

Event handler signalled after a change to the canvas.

TCanvas.RequiredState

  

Ensures that all handles needed for the canvas are valid.

TCanvas.Font

  

Contains the Font used to render text on the drawing surface.

TCanvas.Brush

  

The Brush used to paint on the Canvas.

TCanvas.Pen

  

The Pen to be used for writing in this canvas.

TCanvas.TextStyle

  

Text style attributes used to draw text on the canvas.

ExtUTF8Out

  


Version 3.2 Generated 2024-02-25 Home