A newer version of this page is available. Switch to the current version.

BrickGraphics.DrawPageImage(Image, RectangleF, BorderSide, Color) Method

Adds a specific PageImageBrick to a report.

Namespace: DevExpress.XtraPrinting

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


public PageImageBrick DrawPageImage(
    Image image,
    RectangleF rect,
    BorderSide sides,
    Color backColor
Public Function DrawPageImage(
    image As Image,
    rect As RectangleF,
    sides As BorderSide,
    backColor As Color
) As PageImageBrick


Name Type Description
image Image

The image to draw in a specific brick.

rect RectangleF

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

sides BorderSide

Border settings for a specific PageImageBrick.

backColor Color

The color to be displayed in the transparent portions of an image.


Type Description

The PageImageBrick added to a report.


This method adds a specific PageImageBrick. The brick's position in a report is defined via the rect parameter. This parameter also determines the size of the image displayed within a brick. If the dimensions of the specified rectanlge and actual brick image dimensions are different, the image is stretched or shrunk to fit inside the specified rectangle. To prevent this, the rect dimensions must exactly match the image dimensions. If the image has transparent areas, then these areas are filled with the color specified via backColor. If backColor is set to Color.Empty, the color used to fill transparent areas is defined via the BrickGraphics.BackColor property value.


This example demonstrates how to create a PageImageBrick using the BrickGraphics.DrawPageImage method.


using DevExpress.XtraPrinting;
// ...

    PageImageBrick pimBrick;
    Image img = imageList2.Images[0];
    BrickGraphics brickGraph = printingSystem1.Graph;

    // Start the report generation.

    // Create a rectangle.
    RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(179, 34));

    // Specify a marginal page header area.
    brickGraph.Modifier = BrickModifier.MarginalHeader;

    // Create a page image brick.
    pimBrick = brickGraph.DrawPageImage(img, rect, BorderSide.None, Color.White);

    // Finish the report generation.

    // Preview the report.
See Also