Skip to main content

BrickStringFormat Class

Encapsulates text layout information (such as alignment, orientation and tab stops) and display manipulations (such as ellipsis insertion and national digit substitution).

Namespace: DevExpress.XtraPrinting

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

NuGet Package: DevExpress.Printing.Core

Declaration

public class BrickStringFormat :
    ICloneable

Remarks

The BrickStringFormat class defines formatting for bricks containing text information. Format settings include text, line alignment, and formatting flags.

Example

The following code creates a new BrickStringFormat object and sets the text alignment to Center.

StingForamt example

using DevExpress.XtraPrinting;
using DevExpress.Drawing;
// ...
PrintingSystemBase printingSystem1 = new PrintingSystemBase();

    VisualBrick visBrick;
    BrickGraphics brickGraph = printingSystem1.Graph;
    string s = "Developer Express Inc.";

    // Specify the string format.
    DXStringFormat dxFormat = new DXStringFormat();
    dxFormat.Alignment = DXStringAlignment.Center;
    dxFormat.LineAlignment = DXStringAlignment.Center;

    // Create a BrickStringFormat object.
    BrickStringFormat brickSFormat = new BrickStringFormat(dxFormat);

    // Measure the string according to the specified format.
    SizeF sz = brickGraph.MeasureString(s, 30, dxFormat);

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

    // Set the brick string format
    brickGraph.StringFormat = brickSFormat;

    // Create a rectangle.
    RectangleF rect = new RectangleF(new PointF(0, 0), new SizeF(150, 30));
    // Specify a page area.
    brickGraph.Modifier = BrickModifier.Detail;
    // Add a brick to the report.
    visBrick = brickGraph.DrawString(s, Color.MidnightBlue, rect, BorderSide.All);

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

    // Preview the report.
    printingSystem1.ExportToPdf("report.pdf");

Inheritance

Object
BrickStringFormat
See Also