Skip to main content
Box

PageCanvas.DrawString(String, Font, RichEditBrushBase, Rectangle, DocumentLayoutUnit) Method

Draws a custom string.

Namespace: DevExpress.XtraRichEdit.API.Layout

Assembly: DevExpress.RichEdit.v24.1.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

public void DrawString(
    string str,
    Font font,
    RichEditBrushBase brush,
    Rectangle bounds,
    DocumentLayoutUnit unit
)

Parameters

Name Type Description
str String

A custom string to be drawn.

font Font

Sets the string’s font parameters.

brush RichEditBrushBase

The RichEditBrushBase descendant that sets the string characters’ color and thickness.

bounds Rectangle

Gets the location and size of the string.

unit DocumentLayoutUnit

Specifies measurement units for the string parameters.

Remarks

When you print or export documents, document objects may appear differently from the way they look on screen. To make them look the same in both outputs, set the DocumentLayoutUnit parameter to the same DocumentLayoutUnit value as the one specified for the document layout.

Note

Using this parameter is effective only if the drawn shape has coordinates and parameters represented by absolute values – coordinates represented by relative values already have the same measurement unit as the whole document layout.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DrawString(String, Font, RichEditBrushBase, Rectangle, DocumentLayoutUnit) 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