Skip to main content

GraphicsCache.CalcTextSize(String, Font, Int32) Method

Calculates the size of the specified string when it’s drawn with the specified font.

Namespace: DevExpress.Utils.Drawing

Assembly: DevExpress.Utils.v24.1.dll

NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core

Declaration

public SizeF CalcTextSize(
    string text,
    Font font,
    int maxWidth
)

Parameters

Name Type Description
text String

A String value which represents a string to measure.

font Font

A Font object which defines the font and the associated settings of the text.

maxWidth Int32

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

Returns

Type Description
SizeF

A SizeF structure which represents the size (in pixels) of the string.

See Also