Back to Devexpress

ImageEditorOptions Class

windowsforms-devexpress-dot-xtraprinting-dot-preview-bb40010b.md

latest4.5 KB
Original Source

ImageEditorOptions Class

Provides options for the image editor that you can use to edit the XRPictureBox control’s content in Print Preview.

Namespace : DevExpress.XtraPrinting.Preview

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public class ImageEditorOptions
vb
Public Class ImageEditorOptions

Remarks

Use the RegisterImageEditor(String, String, ImageEditorOptions) method to register an image editor that you can then use to edit the XRPictureBox control’s content in Print Preview. Pass an object of the ImageEditorOptions type as the method’s options parameter. By default, all menu items become available in the registered image editor.

Set the following properties of the passed ImageEditorOptions object to false to remove certain menu items from the editor’s menu:

PropertyTarget Menu ItemMenu Item Behavior
AllowLoadImageInvokes the Open File dialog to load an image to the editor.
AllowChangeSizeOptionsProvides options to change the image size mode and alignment in the editor.
AllowDrawProvides options to set the brush size and color.
AllowClearRemoves all the content the editor contains.

The following code snippet demonstrates how to use the ImageEditorOptions class to register a custom image editor.

csharp
using DevExpress.XtraPrinting.Preview;

//...

ImageEditorOptions imageEditorOptions = new ImageEditorOptions() {
    AllowLoadImage = false,
    AllowChangeSizeOptions = false,
    AllowDraw = true,
    AllowClear = false
};
EditingFieldExtensionsWin.Instance.RegisterImageEditor("DamageDiagram", "Damage Diagram", imageEditorOptions);
vb
Imports DevExpress.XtraPrinting.Preview

'...

Private imageEditorOptions As New ImageEditorOptions() With {
    .AllowLoadImage = False,
    .AllowChangeSizeOptions = False,
    .AllowDraw = True,
    .AllowClear = False
}
EditingFieldExtensionsWin.Instance.RegisterImageEditor("DamageDiagram", "Damage Diagram", imageEditorOptions)

Note

The menu item resets the editor’s content. This item is available only when the Picture Box control’s ImageSource property is originally assigned.

You can also specify the ImageEditorOptions object’s PredefinedImages property to provide end users with a collection of predefined images.

Inheritance

Object ImageEditorOptions

See Also

ImageEditorOptions Members

DevExpress.XtraPrinting.Preview Namespace