Skip to main content

BrickGraphics.MeasureString(String, Font, Int32, StringFormat, GraphicsUnit) Method

Measures the height and width of the specified text string.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v22.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.Win.Dashboard.Design


public static SizeF MeasureString(
    string text,
    Font font,
    int width,
    StringFormat stringFormat,
    GraphicsUnit pageUnit


Name Type Description
text String

String to measure.

font Font

A Font object that defines the text format of the string.

width Int32

An integer value specifying the maximum width of the measured string.

stringFormat StringFormat

A StringFormat object that represents the string’s formatting.

pageUnit GraphicsUnit

A GraphicsUnit enumeration value that specifies the unit of measurement for the return value.


Type Description

This method returns a SizeF structure that represents the size, measured in pixels.


This method is similar to the standard MeasureString method, and is used for more precise calculations.

See Also