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 | Rich |
The Rich |
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
#Related GitHub Examples
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.