Skip to main content

BrickGraphics.DrawImage(Image, RectangleF) Method

Adds a specific ImageBrick brick to a report.

Namespace: DevExpress.XtraPrinting

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

NuGet Packages: DevExpress.Printing.Core, DevExpress.Win.Dashboard.Design


public ImageBrick DrawImage(
    Image image,
    RectangleF rect


Name Type Description
image Image

The image to draw within a specifc 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.


Type Description

The ImageBrick added to a report.


This method adds a specific ImageBrick to a report. The brick’s position is defined via the rect parameter. This parameter also defines brick size. If the rectanlge’s dimensions 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. Graphical settings which are not defined via this method are obtained from the corresponding BrickGraphics properties.


This example demonstrates how to create an ImageBrick using the BrickGraphics.DrawImage method.


using DevExpress.XtraPrinting;
// ...

    VisualBrick visBrick;
    Image img = imageList1.Images[0];   
    BrickGraphics brickGraph = printingSystem1.Graph;

    // Start the report generation.

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

    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;

    // Add an image brick to the report.
    visBrick = brickGraph.DrawImage(img, rect, BorderSide.All, Color.White);

    // Finish the report generation.

    // Preview the report.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DrawImage(Image, RectangleF) method.


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.

See Also