windowsforms-devexpress-dot-xtraeditors-dot-pictureedit-7f5c5d24.md
Sets or gets the image displayed by the editor.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[Bindable(false)]
[DefaultValue(null)]
[DXCategory("Appearance")]
public virtual Image Image { get; set; }
<Bindable(False)>
<DXCategory("Appearance")>
<DefaultValue(Nothing)>
Public Overridable Property Image As Image
| Type | Default | Description |
|---|---|---|
| Image | null |
A Image object representing the image displayed by the picture editor.
|
The Image property value is equivelant to the PictureEdit.EditValue property. The property is declared to avoid type conversion when accessing the image displayed by the editor.
The following example assigns an image to the control.
pictureEdit1.Image = Image.FromFile("workspace.png");
PictureEdit1.Image = Image.FromFile("workspace.png")
The following code snippets (auto-collected from DevExpress Examples) contain references to the Image property.
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.
{
edit.Image = draggedImage;
draggedImage = null;
winforms-imagecollection-load-images-from-assembly/CS/T183237/Form1.cs#L14
InitializeComponent();
pictureEdit1.Image = imageCollection1.Images[0];
}
async void OnMenuItemClick(object sender, EventArgs e) {
if(pictureEdit.Image != null) {
string fileName = $"TestImage{Guid.NewGuid()}.png";
winforms-tab-control-custom-header-buttons/CS/XtraTabControl_CustomButtons/Form1.cs#L53
PictureEdit picEdit = new PictureEdit();
picEdit.Image = img;
picEdit.Dock = DockStyle.Fill;
If (e.AllowedEffect And DragDropEffects.Copy) = DragDropEffects.Copy Then
edit.Image = draggedImage
draggedImage = Nothing
winforms-imagecollection-load-images-from-assembly/VB/T183237/Form1.vb#L11
InitializeComponent()
pictureEdit1.Image = imageCollection1.Images(0)
End Sub
Private Async Sub OnMenuItemClick(ByVal sender As Object, ByVal e As EventArgs)
If pictureEdit.Image IsNot Nothing Then
Dim fileName As String = $"TestImage{Guid.NewGuid()}.png"
winforms-tab-control-custom-header-buttons/VB/XtraTabControl_CustomButtons/Form1.vb#L59
Dim picEdit As PictureEdit = New PictureEdit()
picEdit.Image = img
picEdit.Dock = DockStyle.Fill
See Also