Skip to main content
Box

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

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

Places a custom string.

Namespace: DevExpress.XtraRichEdit.API.Layout

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

NuGet Package: DevExpress.RichEdit.Core

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

View Example

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 snippet (auto-collected from DevExpress Examples) contains a reference 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