Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Box

PageCanvas.DrawString(String, Font, RichEditBrushBase, Point) Method

Places a custom string.

Namespace: DevExpress.XtraRichEdit.API.Layout

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

Declaration

public void DrawString(
    string str,
    Font font,
    RichEditBrushBase brush,
    Point point
)

Parameters

Name Type Description
str String

A custom string to be drawn.

font Font

Sets the custom string’s font parameters.

brush RichEditBrushBase

The RichEditBrushBase object that sets the color and thickness of the string characters.

point Point

Sets the string’s start point coordinates.

Example

This code snippet illustrates the implementation of the PageCanvas.DrawString method. It draws a colored text string over the floating picture.

Public Overrides Sub DrawFloatingPicture(ByVal floatingPicture As LayoutFloatingPicture)
    If Form1.customDrawImage = True Then
        Dim bounds As Rectangle = floatingPicture.Bounds
        Dim startPoint As New Point(bounds.X + 10, bounds.Y + bounds.Height - 40)
        Dim pEn As New RichEditPen(Color.Coral)
        pEn.Thickness = 3
        pEn.DashStyle = RichEditDashStyle.Dash
        Canvas.DrawEllipse(pEn, bounds)
        Canvas.DrawString("Approved", New Font("Courier New", 26), New RichEditBrush(Color.DarkMagenta), startPoint)
    Else
        MyBase.DrawFloatingPicture(floatingPicture)
    End If
End Sub

The following code snippets (auto-collected from DevExpress Examples) contain references to the DrawString(String, Font, RichEditBrushBase, Point) 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