BrickGraphics.DrawRect(RectangleF, BorderSide, Color, Color) Method
Adds a specific VisualBrick to a report.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v24.2.Core.dll
NuGet Package: DevExpress.Printing.Core
#Declaration
public VisualBrick DrawRect(
RectangleF rect,
BorderSide sides,
Color backColor,
Color borderColor
)
#Parameters
Name | Type | Description |
---|---|---|
rect | Rectangle |
The Rectangle |
sides | Border |
Border settings for the current Visual |
back |
Color | The background color for a brick. |
border |
Color | The color of the brick’s border. |
#Returns
Type | Description |
---|---|
Visual |
The Visual |
#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.
#Example
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();
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the DrawRect(RectangleF, BorderSide, Color, Color) method.
Note
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.