Back to Devexpress

dxShowImageEditor(TPicture) Method

vcl-dximageeditordialog-dot-dxshowimageeditor-x28-337f7af5-x29.md

latest4.5 KB
Original Source

dxShowImageEditor(TPicture) Method

Displays the Image Editor dialog for the specified TPicture image container.

Declaration

delphi
function dxShowImageEditor(APicture: TPicture): Boolean;

Parameters

NameTypeDescription
APictureTPicture

The target image container.

The displayed dialog applies pending changes to the stored image when the global function returns True.

|

Returns

TypeDescription
BooleanTrueConfirm changes. If a user clicks the Save button to close the Image Editor dialog or clicks the Yes button in the modal Close Editor dialog to confirm pending changes.FalseDiscard changes. If a user clicks the Close button or clicks the No button in the modal Close Editor dialog.

Remarks

Image Editor is a modal dialog that allows users to perform simple image edit operations, such as cropping, rotation, and color adjustment.

Image Edit Operations

The Image Editor displays the following commands:

Crop

A click on the Crop button displays the Crop operation pane and a crop box with sizing handles in the image display area.

Grayscale

The Grayscale button makes the displayed image black-and-white (sets the Saturation of all image pixels to 0).

You can use the Saturation slider in the Adjust Colors pane for granular control over image saturation.

Adjust Colors

The Adjust Colors button displays the corresponding pane with Contrast , Brightness , and Saturation sliders.

MirrorThis button flips the displayed image horizontally.Rotate Counterclockwise | Rotate ClockwiseThese buttons rotate the displayed image by 90 degrees in the corresponding direction.Undo | RedoThese buttons allow users to navigate the action history.

Display a Standalone Image Editor Dialog

To display the Image Editor dialog for a TPicture image container to allow users to edit the stored image, call the dxShowImageEditor global function.

Display the Image Editor Dialog in cxImage Editors

You can call the ShowImageEditor procedure of a TcxImage or TcxDBImage editor to allow users to edit the image displayed in the editor.

A user can click the Edit… item in the context menu of a TcxImage or TcxDBImage editor to display the Image Editor dialog for the editor:

Tip

You can use an image editor‘s Properties.PopupMenuLayout.MenuItems property to customize the list of context menu items.

The Edit… menu item is available only if the pmiEdit flag is present in the Properties.PopupMenuLayout.MenuItems property value. Refer to the TcxPopupMenuLayout.MenuItems property description for detailed information on menu item management and a code example.

Image Editor Customization

If you need to customize the Image Editor dialog, derive a custom form from the TdxCustomImageEditorDialog class. Then, assign a reference to the custom form to the dxImageEditorClass global variable.

See Also

dxImageEditorDialog Unit