BrickGraphics.DrawRect(RectangleF, BorderSide, Color, Color) Method

Adds a specific VisualBrick to a report.

Namespace: DevExpress.XtraPrinting

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

Declaration

public VisualBrick DrawRect(
    RectangleF rect,
    BorderSide sides,
    Color backColor,
    Color borderColor
)
Public Function DrawRect(
    rect As RectangleF,
    sides As BorderSide,
    backColor As Color,
    borderColor As Color
) As VisualBrick

Parameters

Name Type Description
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 the current VisualBrick.

backColor Color

The background color for a brick.

borderColor Color

The color of the brick's border.

Returns

Type Description
VisualBrick

The VisualBrick added to a report.

Remarks

This method adds a specific VisualBrick to a report. VisualBrick position and size are specified via the rect parameter. Rectangle sides to display are defined via the sides parameter. If this parameter is BorderSide.None, rectangle sides are invisible. The color of rectangle sides is specified via the borderColor parameter. If this value is Color.Transparent, rectangle sides are invisible. The rectangle drawn in the VisualBrick is filled with the color specified via the backColor parameter. If the backColor and borderColor parameters are set to Color.Empty, the background and border colors are specified via the BrickGraphics.BackColor and the BrickGraphics.BorderColor properties.

Examples

The following code demonstrates how to create a VisualBrick and specify its dimensions and border settings, using the BrickGraphics.DrawRect method:

using DevExpress.XtraPrinting;
// ...

    VisualBrick visBrick;
    BrickGraphics brickGraph = printingSystem1.Graph;

    // Start the report generation.
    printingSystem1.Begin();

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

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

    // Add a brick to the report.
    visBrick = brickGraph.DrawRect(rect, BorderSide.All, Color.Yellow, Color.Blue);

    // Finish the report generation.
    printingSystem1.End();

    // Preview the report.
    printingSystem1.PreviewFormEx.Show();
See Also