Table of Contents

Method GetTextExtent

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

GetTextExtent(string, Font, IControl?)

Gets the dimensions of the string using the specified font.

public override SizeD GetTextExtent(string text, Font font, IControl? control)

Parameters

text string

The text string to measure.

font Font

The Font used to get text dimensions.

control IControl

The control used to get scaling factor. Can be null.

Returns

SizeD

SizeD with the total calculated width and height of the text.

Remarks

This function only works with single-line strings. It works faster than MeasureText methods.

GetTextExtent(string, Font)

Gets the dimensions of the string using the specified font.

public override SizeD GetTextExtent(string text, Font font)

Parameters

text string

The text string to measure.

font Font

The Font used to get text dimensions.

Returns

SizeD

SizeD with the total calculated width and height of the text.

Remarks

This function only works with single-line strings. It works faster than MeasureText methods.