corelibraries-devexpress-dot-xtraprinting-29414c7c.md
A visual brick containing an image.
Namespace : DevExpress.XtraPrinting
Assembly : DevExpress.Printing.v25.2.Core.dll
NuGet Package : DevExpress.Printing.Core
[BrickExporter(typeof(ImageBrickExporter))]
public class ImageBrick :
VisualBrick,
IImageBrick,
IVisualBrick,
IBaseBrick,
IBrick,
IXtraSupportAfterDeserialize,
IXtraPartlyDeserializable
<BrickExporter(GetType(ImageBrickExporter))>
Public Class ImageBrick
Inherits VisualBrick
Implements IImageBrick,
IVisualBrick,
IBaseBrick,
IBrick,
IXtraSupportAfterDeserialize,
IXtraPartlyDeserializable
The following members return ImageBrick objects:
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.
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.
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();
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()
IXtraSupportDeserializeCollectionItem
Object DevExpress.Printing.Utils.DocumentStoring.StorableObjectBase BrickBase Brick VisualBrick ImageBrick PageImageBrick
See Also