The requested page is not available for the requested platform. You are viewing the content for Default platform.
All docs
V19.1
19.2 (EAP/Beta)
19.1
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

XtraReport.ImageResources Property

Provides access to a collection of the report's named images.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.1.dll

Declaration

[SRCategory(ReportStringId.CatData)]
public ImageItemCollection ImageResources { get; }
<SRCategory(ReportStringId.CatData)>
Public ReadOnly Property ImageResources As ImageItemCollection

Property Value

Type Description
ImageItemCollection

A named image collection.

Remarks

Populate this collection with images to use them in the following report controls:

  • Label
    If the AllowMarkupText property is enabled, you can specify the name of the collection image in the label's image tag. Example: <image=UpArrow.png>

  • PictureBox
    You can construct the ImageSource property's expression to set the collection image conditionally.

Design Time

Click the ImageResources property's ellipsis button in the Properties window. The Image Resource Collection Editor is invoked. This editor allows you to manipulate with the image collection: add, reorder and remove named images.

ImageSource-OpenFileDialog

Visual Studio Report Designer

When you add an image in Visual Studio Report Designer, the Image Picker is invoked. It allows you to choose an external image or an image from the DevExpress Image Library.

You can choose whether to add the selected image to the report or project resources. If you add the image to project resources, you can reuse it in several reports.

End-User Report Designer

When you add an image in the End-User Report Designer, the Open File dialog is invoked.

ImageSource-OpenFileDialog

The selected image is saved to the report definition .repx file.

Runtime

The code sample below illustrates how to use a report's image resources to insert an image to a label.

using DevExpress.XtraPrinting.Drawing;
using DevExpress.XtraReports.UI;
using System.Drawing;
// ...
XtraReport report = new XtraReport();
Image image = Image.FromFile("testImage.png");
ImageItem imageItem = new ImageItem("img1", new ImageSource(image));
report.ImageResources.Add(imageItem);

XRLabel label = new XRLabel() {
    AllowMarkupText = true,
    WordWrap = true,
    Text = "Test<br>" + 
        "<size=14>Size = 14<br>" +
        "<b>Bold</b> <i>Italic</i> <u>Underline</u></size><br>" +
        "<size=11>Size = 11<br>" +
        "<color=255,0,0>Sample Text</color></size><br>" +
        "<href=www.devexpress.com>Hyperlink</href><br>" +
        "<image=img1>"
};

DetailBand detailBand = new DetailBand();
detailBand.Controls.Add(label);
report.Bands.Add(detailBand);
See Also