[]
        
(Showing Draft Content)

C1.Framework.Drawing.Gdi.DeviceContexts.DeviceContext.TextExtentEx

TextExtentEx Method

TextExtentEx(string, int, out int, int[])

Retrieves the number of characters in a specified string that will fit within a specified space and fills an array with the text extent for each of those characters.

Declaration
public Size TextExtentEx(string text, int maxExtent, out int fitCharNumber, int[] fitExtents)
Parameters
Type Name Description
string text

A string for which extents are to be retrieved.

int maxExtent

Specifies the maximum allowable width, in logical units, of the formatted string.

int fitCharNumber

Receives a count of the maximum number of characters that will fit in the space specified by the maxExtent parameter.

int[] fitExtents

Pointer to an array of integers that receives partial string extents. Each element in the array gives the distance, in logical units, between the beginning of the string and one of the characters that fits in the space specified by the maxExtent parameter. This array must have at least as many elements as character count in text. The function fills the array with valid extents for as many characters as are specified by the fitCharNumber parameter.

Returns
Type Description
Size

Receives the dimensions of the string, in logical units.