Skip to main content
A newer version of this page is available. .

AppearanceObject.CalcTextSize(GraphicsCache, String, Int32) Method

Calculates the size of the specified string.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v19.2.dll

Declaration

public SizeF CalcTextSize(
    GraphicsCache cache,
    string s,
    int width
)

Parameters

Name Type Description
cache GraphicsCache

A GraphicsCache object which provides storage for pens, fonts and brushes.

s String

The string to be measured.

width Int32

An integer value specifying the maximum width of the string (in pixels).

Returns

Type Description
SizeF

The measured size of the string, in pixels.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CalcTextSize(GraphicsCache, String, Int32) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also