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

XRPictureBox.Image Property

Bindable. Gets or sets the image to be displayed in the XRPictureBox control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

[Browsable(false)]
public Image Image { get; set; }

Property Value

Type Description
Image

The image to be displaed in the picture box.

Remarks

This property is obsolete. Use the ImageSource property instead. It extends the list of supported image formats with SVG.

Example

This example demonstrates how to create an XRPictureBox object and specify its properties.

using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
using DevExpress.XtraReports.UI;
using System.Drawing;
// ...
public XRPictureBox CreateXRPictureBox()
{
    // Create an XRPictureBox instance.
    XRPictureBox xrPictureBox = new XRPictureBox();

    // Specify an image for the created XRPictureBox instance.
    xrPictureBox.ImageSource = ImageSource.FromFile("Images\\Flags\\United_States_of_America.png");
    // Uncomment these lines to get images from a data source.
    // ExpressionBinding expressionBinding = new ExpressionBinding("BeforePrint", "ImageSource", "[Picture]");
    // xrPictureBox.ExpressionBindings.Add(expressionBinding);

    // Position the picture box within a document.
    xrPictureBox.LocationF = new PointF(150F, 25F);

    // Set the picture box size.
    xrPictureBox.SizeF = new SizeF(160F, 120F);

    // Set the picture box size mode.
    xrPictureBox.Sizing = ImageSizeMode.AutoSize;

    // Specify that the image in the picture box should use the default DPI value.
    xrPictureBox.UseImageResolution = false;

    return xrPictureBox;
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Image property.

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.

See Also