EditingFieldExtensions.RegisterImageEditorInfo(String, ImageEditorOptions, String) Method

Registers a custom image editor that you can use to edit the XRPictureBox's content in Print Preview.

Namespace: DevExpress.Xpf.Printing

Assembly: DevExpress.Xpf.Printing.v20.2.dll

Declaration

public bool RegisterImageEditorInfo(
    string editorName,
    ImageEditorOptions options,
    string displayName = null
)
Public Function RegisterImageEditorInfo(
    editorName As String,
    options As ImageEditorOptions,
    displayName As String = Nothing
) As Boolean

Parameters

Name Type Description
editorName String

The registered image editor's unique name.

options ImageEditorOptions

An object that provides settings for the registered image editor.

Optional Parameters

Name Type Default Description
displayName String

null

The registered image editor's display name.

Returns

Type Description
Boolean

true, if the image editor has been successfully registered; otherwise, false.

Remarks

You can use one of the predefined image editors in Print Preview:

"Image" "Signature" "Image and Signature"
Image Predefined Editor Signature Predefined Editor Image and Signature Predefined Editor

Use the RegisterImageEditorInfo method to register an image editor with a custom set of menu items. Pass an object of the ImageEditorOptions type as the method's options parameter.

using DevExpress.Xpf.Printing;

//...

ImageEditorOptions imageEditorOptions = new ImageEditorOptions() {
    AllowLoadImage = false,
    AllowChangeSizeOptions = false,
    AllowDraw = true,
    AllowClear = false
};
EditingFieldExtensions.Instance.RegisterImageEditorInfo("DamageDiagram", imageEditorOptions, "Damage Diagram");
NOTE

The Reset Icon menu item resets the editor's content. This item is available only when the Picture Box control has an original image (see ImageSource).

You can also add the Predefined Images Menu Item item to the image editor's menu. This item allows end users to choose one of the predefined images and load it to the editor. Use the PredefinedImages property to specify the predefined image collection.

Predefined Images

To use the registered editor in Print Preview, set a XRPictureBox control's EditOptions | Enabled property to true and the EditOptions | EditorName property - to the registered editor's name.

The following sample demonstrates how to do this in code.

using DevExpress.XtraReports.UI;

//...

XtraReport1 report = new XtraReport1();
XRPictureBox pictureBox = report.Bands["ReportHeader"].FindControl("xrPictureBox1", true) as XRPictureBox;
pictureBox.EditOptions.Enabled = true;
pictureBox.EditOptions.EditorName = "DamageDiagram";

An end user can set the registered image editor in the End-User Report Designer's Property Grid.

RegisterImageEditor_Set Editor an Design Time

The following image demonstrates the registered image editor that allows end users to draw only.

RegisterImageEditor_Result

See Also