Skip to main content
A newer version of this page is available. .

XRPictureBox Class

A Picture Box control that is used to display an image in a report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v17.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[DefaultBindableProperty("Image")]
public class XRPictureBox :
    XRControl

Remarks

The XRPictureBox control is typically used to display graphics from a bitmap, JPEG, GIF or PNG file. This picture is specified either by the XRPictureBox.Image or the XRPictureBox.ImageUrl property. The clipping and positioning of an image in the display area of the XRPictureBox is controlled by the XRPictureBox.Sizing property set to a ImageSizeMode enumeration value.

For more detailed information about the XRPictureBox control, see Picture Box.

Example

This example demonstrates how to create an XRPictureBox object, and set some of its properties.

using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...

public XRPictureBox CreateXRPictureBox()
{
    // Create an XRPictureBox object.
    XRPictureBox xrPictureBox = new XRPictureBox();

    // Set its image.
    xrPictureBox.Image = new Bitmap("C:\\test.bmp");
    // Uncomment these lines to get images from a data source.
    // ExpressionBinding expressionBinding = new ExpressionBinding("BeforePrint", "Image", "[Picture]");
    // xrPictureBox.ExpressionBindings.Add(expressionBinding);

    // Set its location.
    xrPictureBox.LocationF = new PointF(150F, 25F);

    // Set its size.
    xrPictureBox.SizeF = new SizeF(160F, 120F);

    // Set its size mode.
    xrPictureBox.Sizing = ImageSizeMode.AutoSize;

    return xrPictureBox;
}

Implements

See Also