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")]
public class XRPictureBox :
XRControl,
IEditOptionsContainer
Remarks
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.
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;
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;
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the XRPictureBox class.
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.