Upraviť

Zdieľať cez


ImageEditor Class

Definition

Important

This API is not CLS-compliant.

Provides a user interface for selecting an image for a property in a property grid.

public ref class ImageEditor : System::Drawing::Design::UITypeEditor
public class ImageEditor : System.Drawing.Design.UITypeEditor
[System.CLSCompliant(false)]
public class ImageEditor : System.Drawing.Design.UITypeEditor
type ImageEditor = class
    inherit UITypeEditor
[<System.CLSCompliant(false)>]
type ImageEditor = class
    inherit UITypeEditor
Public Class ImageEditor
Inherits UITypeEditor
Inheritance
ImageEditor
Derived
Attributes

Examples

The following code example uses an EditorAttribute to associate the ImageEditor with a property.

public:
   [EditorAttribute(System::ComponentModel::Design::CollectionEditor::typeid,
      System::Drawing::Design::UITypeEditor::typeid)]
   property Image^ testImage 
   {
      Image^ get()
      {
         return testImg;
      }
      void set( Image^ value )
      {
         testImg = value;
      }
   }
private:
   Image^ testImg;
[EditorAttribute(typeof(System.Drawing.Design.ImageEditor), typeof(System.Drawing.Design.UITypeEditor))]
public Image testImage
{
    get
    {
        return testImg;
    }
    set
    {
        testImg = value;
    }
}
private Image testImg;
<EditorAttribute(GetType(System.Drawing.Design.ImageEditor), GetType(System.Drawing.Design.UITypeEditor))>  _
Public Property testImage() As Image
   Get
      Return testImg
   End Get
   Set
      testImg = value
   End Set
End Property
Private testImg As Image

Remarks

An ImageEditor is a UITypeEditor that provides a user interface for the user to select an image for a property. When the user starts the editor, it displays an Open File dialog box that enables the user to navigate to a directory and select a file. The file list is initially filtered by the default file name extensions for the editor.

Constructors

ImageEditor()

Initializes a new instance of the ImageEditor class.

Properties

IsDropDownResizable

Gets a value indicating whether drop-down editors should be resizable by the user.

(Inherited from UITypeEditor)

Methods

CreateExtensionsString(String[], String)

Creates a string of file name extensions using the specified array of file extensions and the specified separator.

CreateFilterEntry(ImageEditor)

Creates a filter entry for a file dialog box's file list.

EditValue(IServiceProvider, Object)

Edits the value of the specified object using the editor style indicated by the GetEditStyle() method.

(Inherited from UITypeEditor)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object value using the edit style provided by the GetEditStyle(ITypeDescriptorContext) method.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEditStyle()

Gets the editor style used by the EditValue(IServiceProvider, Object) method.

(Inherited from UITypeEditor)
GetEditStyle(ITypeDescriptorContext)

Gets the editing style of the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.

GetExtensions()

Gets the extensions for the file-list filter that this editor initially uses to filter the file list.

GetFileDialogDescription()

Gets the description for the default file-list filter provided by this editor.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetImageExtenders()

Gets an array of supported image types.

GetPaintValueSupported()

Indicates whether this editor supports painting a representation of an object's value.

(Inherited from UITypeEditor)
GetPaintValueSupported(ITypeDescriptorContext)

Gets a value indicating whether this editor supports painting a representation of an object's value.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
LoadFromStream(Stream)

Loads an image from the specified stream.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
PaintValue(Object, Graphics, Rectangle)

Paints a representation of the value of the specified object to the specified canvas.

(Inherited from UITypeEditor)
PaintValue(PaintValueEventArgs)

Paints a value indicated by the specified PaintValueEventArgs.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also