Back to Devexpress

PictureEdit.Image Property

windowsforms-devexpress-dot-xtraeditors-dot-pictureedit-7f5c5d24.md

latest5.8 KB
Original Source

PictureEdit.Image Property

Sets or gets the image displayed by the editor.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[Bindable(false)]
[DefaultValue(null)]
[DXCategory("Appearance")]
public virtual Image Image { get; set; }
vb
<Bindable(False)>
<DXCategory("Appearance")>
<DefaultValue(Nothing)>
Public Overridable Property Image As Image

Property Value

TypeDefaultDescription
Imagenull

A Image object representing the image displayed by the picture editor.

|

Remarks

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.

csharp
pictureEdit1.Image = Image.FromFile("workspace.png");
vb
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.

winforms-pictureedit-drag-images-from-windows-explorer/CS/WindowsApplication3/DragDropProvider.cs#L42

csharp
{
    edit.Image = draggedImage;
    draggedImage = null;

winforms-imagecollection-load-images-from-assembly/CS/T183237/Form1.cs#L14

csharp
InitializeComponent();
    pictureEdit1.Image = imageCollection1.Images[0];
}

how-to-load-and-upload-images-from-and-to-azure-blob-storage/CS/DXApplication/DXApplication/Main.cs#L67

csharp
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

csharp
PictureEdit picEdit = new PictureEdit();
picEdit.Image = img;
picEdit.Dock = DockStyle.Fill;

winforms-pictureedit-drag-images-from-windows-explorer/VB/WindowsApplication3/DragDropProvider.vb#L41

vb
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

vb
InitializeComponent()
    pictureEdit1.Image = imageCollection1.Images(0)
End Sub

how-to-load-and-upload-images-from-and-to-azure-blob-storage/VB/DXApplication/DXApplication/Main.vb#L70

vb
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

vb
Dim picEdit As PictureEdit = New PictureEdit()
picEdit.Image = img
picEdit.Dock = DockStyle.Fill

See Also

PictureAlignment

SizeMode

EditValue

SvgImage

ImageChanged

PictureEdit Class

PictureEdit Members

DevExpress.XtraEditors Namespace