BrickGraphics.DrawBrick(Brick, RectangleF) Method

Adds a brick to a report.

Namespace: DevExpress.XtraPrinting

Assembly: DevExpress.Printing.v21.1.Core.dll


public Brick DrawBrick(
    Brick brick,
    RectangleF rect


Name Type Description
brick Brick

The brick to be added to a report.

rect RectangleF

A RectangleF structure that specifies the location and size of the current brick in measurement units, specified via the BrickGraphics.PageUnit property value.


Type Description

The brick added to a report.


This method can be used to add any brick type to a report.


Enclose the document creation statements into the PrintingSystemBase.Begin and PrintingSystemBase.End call pair.


The following code demonstrates how to use the BrickGraphics.DrawBrick method to draw a predefined brick in a report. Note that prior to executing this code, it’s required to add the PrintingSystem component (called printingSystem1) to your application.


A complete sample project is available in the DevExpress Code Examples database at

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

private void button1_Click(object sender, EventArgs e) {
    // Obtain the PrintingSystem's graphics.
    BrickGraphics gr = printingSystem1.Graph;

    // Load an image from a file.
    Image img = Image.FromFile(@"..\..\Data\Fish.png");

    // Create an ImageBrick and specify its properties.
    ImageBrick ibrk = new ImageBrick();
    ibrk.Image = img;
    ibrk.Sides = BorderSide.All;
    ibrk.BorderColor = Color.Blue;
    ibrk.BorderWidth = 10;

    // Start report generation.

    // Add the ImageBrick to the Detail section of the report.
    RectangleF r = new RectangleF(new PointF(0, 0), new SizeF(256, 160));
    gr.Modifier = BrickModifier.Detail;
    gr.DrawBrick(ibrk, r);

    // Finish report generation.

    // Display the Print Preview form.
See Also