XRPictureBox Class

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v18.2.dll

Declaration

[DefaultBindableProperty("ImageSource")]
[XRToolboxSubcategory(0, 3)]
public class XRPictureBox :
    XRControl,
    IXRSerializable,
    IEnumerable,
    IBrickOwner,
    IScriptable,
    IXtraSupportDeserializeCollectionItem,
    IXtraSerializable,
    IEditOptionsContainer
<DefaultBindableProperty("ImageSource")>
<XRToolboxSubcategory(0, 3)>
Public Class XRPictureBox
    Inherits XRControl
    Implements IXRSerializable,
               IEnumerable,
               IBrickOwner,
               IScriptable,
               IXtraSupportDeserializeCollectionItem,
               IXtraSerializable,
               IEditOptionsContainer

The XRPictureBox control is used to display graphics from a BMP, JPG, JPEG, GIF, TIF, TIFF, PNG, ICO, DIB, RLE, JPE, JFIF, EMF, WMF or SVG file. This picture is specified either by the XRPictureBox.ImageSource 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.

Examples

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;
using DevExpress.XtraPrinting.Drawing;
// ...

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

    // Set its image.
    xrPictureBox.ImageSource = new ImageSource(new Bitmap("C:\\test.bmp"));
    // Uncomment these lines to get images from a data source.
    // ExpressionBinding expressionBinding = new ExpressionBinding("BeforePrint", "ImageSource", "[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;
}

Inheritance

Object
XRControl
XRPictureBox

Implements

DevExpress.Utils.Serializing.Helpers.IXtraSupportDeserializeCollectionItem
DevExpress.Utils.Serializing.IXtraSerializable

See Also