XRPictureBox() Constructor
Initializes a new instance of the XRPictureBox class with the default settings.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v19.2.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Example
This example demonstrates how to create an XRPictureBox object and specify its properties.
using System.Drawing;
using DevExpress.XtraReports.UI;
using DevExpress.XtraPrinting;
using DevExpress.XtraPrinting.Drawing;
// ...
public XRPictureBox CreateXRPictureBox() {
// Create an XRPictureBox instance.
XRPictureBox xrPictureBox = new XRPictureBox();
// Specify an image for the created XRPictureBox instance.
// The image at C:\test.bmp has no DPI settings.
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);
// 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;
}
See Also