[]
        
(Showing Draft Content)

GrapeCity.Drawing.IDrawingContext.MeasureText

MeasureText Method

MeasureText(RichText, Font, Size, bool)

Measure the displayed size of rich text in context.

Declaration
Size MeasureText(RichText richText, Font baseFont, Size size, bool wordWrap)
Function MeasureText(richText As RichText, baseFont As Font, size As Size, wordWrap As Boolean) As Size
Parameters
Type Name Description
RichText richText

Rich text content.

Font baseFont

Base font of rich text.

Size size

The current boundary size.

bool wordWrap

true if allow word wrap and false for otherwise.

Returns
Type Description
Size

The Size represent displayed size of rich text.

MeasureText(TextDocument, TextFormat, Size)

Measure the displayed size of rich text in context.

Declaration
Size MeasureText(TextDocument text, TextFormat baseFormat, Size size)
Function MeasureText(text As TextDocument, baseFormat As TextFormat, size As Size) As Size
Parameters
Type Name Description
TextDocument text

The text document.

TextFormat baseFormat

Base format of rich text.

Size size

The current boundary size.

Returns
Type Description
Size

The Size represent displayed size of rich text.

MeasureText(string, Font, Size, DrawingTextFormat, double)

Measure the size of a string in the context.

Declaration
Size MeasureText(string str, Font font, Size size, DrawingTextFormat drawingTextFormat = DrawingTextFormat.None, double rotation = 0)
Function MeasureText(str As String, font As Font, size As Size, Optional drawingTextFormat As DrawingTextFormat = DrawingTextFormat.None, Optional rotation As Double = 0) As Size
Parameters
Type Name Description
string str

String content

Font font

Font to measure

Size size

The current boundary size.

DrawingTextFormat drawingTextFormat

DrawingTextFormat structure that specifies the drawing text format.

double rotation
Returns
Type Description
Size

The size of displayed string.