[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Calculates the width and height for the specified Text using the Font for the canvas.
Source position: graphics.pp line 1167
public function TCanvas.TextExtent( |
const Text: string |
):TSize; virtual; |
Text |
|
Text examined and measured in the method. |
TSize instance with the Width and Height for the text.
TextExtent is a TSize function used to get the width and height for the specified Text using the Font for the canvas instance.
The TSize type in the return value returns the Width and Height for the Text in pixels using the cX (Width) and cY (Height) members. Both members are set to 0 if Text is an empty string (''), and when either the Handle or Font for the canvas are invalid. The CreateHandle and CreateFont methods are called to attempt to create the items when needed.
If the Font has the default un-initialized settings, the OnGetSystemFont event handler is signalled to get the default system font selected for the canvas.
TextExtent calls the GetTextExtentPoint routine in the widgetset interface to get the return value for the method.
TextExtent is used in methods like TextWidth, TextHeight and DoGetTextSize.
|
Ensures that all handles needed for the canvas are valid. |
|
|
Handle (or device context) for the drawing surface. |
|
|
Contains the Font used to render text on the drawing surface. |
|
|
Creates a new Handle for the Canvas. |
|
|
Ensures that the Font for the canvas is valid and uses the correct color. |
|
|
Gets the width for the specified text using the canvas Font. |
|
|
Gets the height for the specified text using the canvas Font. |
|
|
Calls TextExtent to find the width and height of the specified text. |
|
|
Address of the routine used to get the handle for the system font. |
Version 3.2 | Generated 2024-02-25 | Home |