Back to Devexpress

BrickGraphics Class

corelibraries-devexpress-dot-xtraprinting-52c20300.md

latest4.3 KB
Original Source

BrickGraphics Class

Implements report drawing functions.

Namespace : DevExpress.XtraPrinting

Assembly : DevExpress.Printing.v25.2.Core.dll

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
public class BrickGraphics :
    IDisposable,
    IBrickGraphics
vb
Public Class BrickGraphics
    Implements IDisposable,
               IBrickGraphics

The following members return BrickGraphics objects:

LibraryRelated API Members
Cross-Platform Class LibraryCreateAreaEventArgs.Graph
PrintingSystemBase.Graph
WinForms ControlsPrintRowEventArgs.BrickGraphics
.NET Multi-platform App UIBrickGeneratedEventArgs.Graphics

Remarks

The BrickGraphics class implements drawing within a report. Its members define the default settings of font, fore and background color, border sides, and alignment for all bricks created using the current BrickGraphics object instance. This class also declares the methods used to create different brick types, and additional functions to implement measurement unit conversion, measure strings, etc.

For more information on using BrickGraphics , refer to the Brick Graphics document.

Example

The following example demonstrates how to write a LinkBase.CreateMarginalHeaderArea event handler. The handler will not work unless you write a LinkBase.CreateDetailArea event handler.

csharp
using System.Drawing;
using DevExpress.XtraPrinting;
// ...

private void link1_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) {
    string format = "Page {0} of {1}";
    e.Graph.Font = e.Graph.DefaultFont;
    e.Graph.BackColor = Color.Transparent;

    RectangleF r = new RectangleF(0, 0, 0, e.Graph.Font.Height);

    PageInfoBrick brick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, format, 
        Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Far;
    brick.AutoWidth = true;

    brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None);
    brick.Alignment = BrickAlignment.Near;
    brick.AutoWidth = true;
}
vb
Imports System.Drawing
Imports DevExpress.XtraPrinting
' ...

Private Sub Link1_CreateMarginalHeaderArea(ByVal sender As Object, ByVal e As _
CreateAreaEventArgs) Handles Link1.CreateMarginalHeaderArea

    Dim Format As String = "Page {0} of {1}"
    e.Graph.Font = e.Graph.DefaultFont
    e.Graph.BackColor = Color.Transparent

    Dim r As New RectangleF(0, 0, 0, e.Graph.Font.Height)

    Dim Brick As PageInfoBrick = e.Graph.DrawPageInfo(PageInfo.NumberOfTotal, Format, _
        Color.Black, r, BorderSide.None)
    Brick.Alignment = BrickAlignment.Far
    Brick.AutoWidth = True

    Brick = e.Graph.DrawPageInfo(PageInfo.DateTime, "", Color.Black, r, BorderSide.None)
    Brick.Alignment = BrickAlignment.Near
    Brick.AutoWidth = True
End Sub

Implements

IBrickGraphics

Inheritance

Object BrickGraphics

See Also

BrickGraphics Members

Document Creation Approaches

DevExpress.XtraPrinting Namespace