wpf-devexpress-dot-xpf-dot-editors-afbe69b5.md
Represents an image editor.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
[DXLicenseWpfEditors]
public class ImageEdit :
BaseEdit,
IImageEdit,
IInputElement,
IImageExportSettings,
IExportSettings
<DXLicenseWpfEditors>
Public Class ImageEdit
Inherits BaseEdit
Implements IImageEdit,
IInputElement,
IImageExportSettings,
IExportSettings
The ImageEdit control is an editor that allows you to display images in various formats.
Tip
The ImageEdit class inherits its features from the BaseEdit class.
Refer to the BaseEdit class description for information on derived features and API.
The DevExpress WPF Editors Library has a popup variation of the ImageEdit control: PopupImageEdit.
<Window ...
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<!-- Specify value using the ImageEdit.Source property -->
<dxe:ImageEdit Source="../Images/Persons/m02.jpg" ShowMenuMode="Hover"/>
<!-- Specify value using the BaseEdit.EditValue property.
Userpic is a data context field that stores values of Byte[] type. -->
<dxe:ImageEdit EditValue="{Binding UserPic}" />
Use the Source property to specify a path to the editor’s image. Note, that end users can load their own images when the image menu is available.
You can use the EditValue property to get or set the displayed image as an array of bytes.
Always or Empty, users can click within an image editor to open the Open dialog and load a new image.Attach the ImageEditToEditModeBehavior to the ImageEdit to switch the editor to edit mode. In this mode, users can modify the image as follows:
Refer to the following help topic for more information: ImageEditToEditModeBehavior.
The ImageEdit control supports the following image formats.
The ImageEdit control does not support transparency.
Use the ImageEdit.ShowMenu and ImageEdit.ShowMenuMode properties to control the availability of the image menu.
Use the ImageEdit.MenuTemplate and ImageEdit.MenuContainerTemplate properties to implement a custom menu appearance.
To specify how the image should be stretched to fill the available space, use the ImageEdit.Stretch property. The following stretch modes are available.
Image menu contains the Take Snapshot button. Clicking this button allows end users to take a picture using a web camera.
The following code snippets (auto-collected from DevExpress Examples) contain references to the ImageEdit class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-imageedit-edit-images-in-separate-window/CS/ImageEditToEditModeBehavior/MainWindow.xaml#L35
</Grid.RowDefinitions>
<dxe:ImageEdit x:Name="imageEdit" Source="{Binding Source, Mode=TwoWay}" ShowMenu="False"/>
<StackPanel Grid.Row="1" Margin="2" Orientation="Horizontal" HorizontalAlignment="Center">
wpf-property-grid-apply-data-annotation-attributes/CS/MainWindow.xaml#L10
<DataTemplate x:Key="ImageTemplate">
<dxe:ImageEdit Name="PART_Editor"/>
</DataTemplate>
<dxlc:LayoutItem HorizontalAlignment="Right" VerticalAlignment="Top">
<dxe:ImageEdit Height="128" EditValue="{Binding Path=Photo, Mode=TwoWay}" />
</dxlc:LayoutItem>
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control BaseEdit ImageEdit
See Also