Skip to main content
Pie
ra0

TcxCanvas.GetTextStringsBounds(string,TRect,Integer,Boolean,TRects) Method

Returns bounding rectangles for text that fits into the target rectangle at the specified settings.

Declaration

procedure GetTextStringsBounds(Text: string; R: TRect; Flags: Integer; Enabled: Boolean; var ABounds: TRects);

Parameters

Name Type
Text string
R TRect
Flags Integer
Enabled Boolean
ABounds TRects

Remarks

A text draw routines can wrap a text string whose length does not fit into the target rectangle. Call the GetTextStringsBounds procedure to obtain the bounding boxes of all individual text lines within the target rectangle passed as the R parameter. Pass the source string and concomitant text display flags as the Text and Flags parameters, respectively. The GetTextStringsBounds procedure uses the same flags as the DrawTexT procedures.

The Enabled parameter specifies how the procedure treats the text string’s state in an application UI, that is, enabled or disabled. “Disabled” text can cast a shadow, and thus require more space. Pass an array of rectangles as the ABounds parameter to populate it with bounding rectangles of individual text lines at the specified settings.

Note

Call the GetTextStringsBounds and AlignMultiLineTextRectVertically procedures to calculate the UI space required to fit text drawn by the overloaded DrawTexT procedures.

See Also