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

PageCanvas Class

Encapsulates the layout drawing surface.

Namespace: DevExpress.XtraRichEdit.API.Layout

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

Declaration

public abstract class PageCanvas

Remarks

The PageCanvas class provides methods for drawing objects in the document layout.

Use the PagePainter.Canvas property to obtain the PageCanvas object in overridden methods of the PagePainter descendant.

Use the BeforePagePaintEventArgs.Canvas property to access the PageCanvas object and perform a custom draw in the BeforePagePaint event handler.

The PageCanvas enables you to draw lines and shapes, with the specific Draw_GraphicalElement_ method. You can also draw images with the PageCanvas.DrawImage method and text with the PageCanvas.DrawString method.

For complex drawings, you may need to convert the document units of measurement to the units used in layout drawings. The PageCanvas.ConvertToDrawingLayoutUnits method is implemented to accomplish this task.

Example

This code snippet illustrates the implementation of a PagePainter descendant. It draws color rectangles in place of the words and labels a floating picture with a text string drawn over it.

Public Class MyLayoutPainter
    Inherits PagePainter

Inheritance

Object
PageCanvas
See Also