Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

GraphicsCache.CalcTextSize(String, Font) Method

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

Namespace: DevExpress.Utils.Drawing

Assembly: DevExpress.Utils.v24.2.dll

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

#Declaration

public SizeF CalcTextSize(
    string text,
    Font font
)

#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.

#Returns

Type Description
SizeF

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

See Also