Skip to content

Canvas::TextWidth method

Returns the width in pixels, of a string if rendered with the current font.

Prototype

int TextWidth(string text)
int TextWidth(string text) throws IGRException;
def TextWidth(self, text: string) -> int
int TextWidth(const std::wstring& text)
int TextWidth(std::wstring text)
HRESULT TextWidth([in] BSTR text, [out, retval] int *result)

Parameters

text: string : A string containing the text to be measured.

Return value

int : Integer expressing the width or height.