CDC::GetTextExtent

Syntax

CSize GetTextExtent( const char FAR* lpString, int nCount ) const;

Parameters

lpString

Points to a string of characters. You can also pass a CString object for this parameter.

nCount

Specifies the number of characters in the string.

Remarks

Computes the width and height of a line of text, using the current font to determine the dimensions.

Since some devices do not place characters in regular cell arrays (that is, they carry out kerning), the sum of the extents of the characters in a string may not be equal to the extent of the string.

Return Value

The dimensions of the string (in logical units).

See Also

CDC::GetTabbedTextExtent, ::GetTextExtentEx, CDC::SetTextJustification