Back to Devexpress

ImageBrick Class

corelibraries-devexpress-dot-xtraprinting-29414c7c.md

latest4.6 KB
Original Source

ImageBrick Class

A visual brick containing an image.

Namespace : DevExpress.XtraPrinting

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

NuGet Package : DevExpress.Printing.Core

Declaration

csharp
[BrickExporter(typeof(ImageBrickExporter))]
public class ImageBrick :
    VisualBrick,
    IImageBrick,
    IVisualBrick,
    IBaseBrick,
    IBrick,
    IXtraSupportAfterDeserialize,
    IXtraPartlyDeserializable
vb
<BrickExporter(GetType(ImageBrickExporter))>
Public Class ImageBrick
    Inherits VisualBrick
    Implements IImageBrick,
               IVisualBrick,
               IBaseBrick,
               IBrick,
               IXtraSupportAfterDeserialize,
               IXtraPartlyDeserializable

The following members return ImageBrick objects:

Remarks

ImageBrick is used to draw an image in a document and provides options that define the image settings.

An image can be a bitmap, cursor or metafile and is assigned via the ImageBrick.ImageSource property.

Example

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

csharp
using DevExpress.XtraPrinting;
// ...

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

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

    // 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.
    printingSystem1.End();

    // Preview the report.
    printingSystem1.PreviewFormEx.Show();
vb
Imports DevExpress.XtraPrinting
' ...

    Dim visBrick As VisualBrick
    Dim img As Image = imageList1.Images(0)
    Dim brickGraph As BrickGraphics = printingSystem1.Graph

    ' Start the report generation.
    printingSystem1.Begin()

    ' Create a rectangle.
    Dim rect As RectangleF = 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.
    printingSystem1.End()

    ' Preview the report.
    printingSystem1.PreviewFormEx.Show()

Implements

IXtraSupportDeserializeCollectionItem

ITableCell

IBrick

Inheritance

Object DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase BrickBase Brick VisualBrick ImageBrick PageImageBrick

See Also

ImageBrick Members

Bricks

Classes Hierarchy: Bricks

DevExpress.XtraPrinting Namespace