XRPictureBox.UseImageResolution Property

Gets or sets whether to use the original image DPI (dots per inch) value when the image is rendered in a report.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

Declaration

[SRCategory(ReportStringId.CatBehavior)]
[DefaultValue(true)]
[Browsable(false)]
public bool UseImageResolution { get; set; }
<SRCategory(ReportStringId.CatBehavior)>
<DefaultValue(True)>
<Browsable(False)>
Public Property UseImageResolution As Boolean

Property Value

Type Default Description
Boolean

true

true, to use the original image resolution; otherwise, false.

Remarks

Set this property to false to use images that have no DPI settings, and to render these images with the same size on any device.

When this property is set to false, the value of 96 DPI is used.

Set this property to true to use the DPI value specified in the image. Call the SetResolution(Single, Single) method to specify a custom resolution for an image.

Examples

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