Skip to main content

ImageConverter

Namespace: System.Drawing

Assembly: System.Drawing.Managed (4.0.0.0)

Provides a type converter to convert Image objects to and from various other representations. This class supports conversion from byte arrays to Image objects and vice versa.

public class ImageConverter : TypeConverter

Constructors

Instance member ImageConverter()

Initializes a new instance of ImageConverter.

Methods

Instance member CanConvertFrom(context, sourceType)

Determines whether this converter can convert an object of the specified type to an Image, using the specified context.

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
sourceTypeTypeThe Type to evaluate for conversion.

Returns: Boolean. if the conversion is possible; otherwise, .

Instance member CanConvertTo(context, destinationType)

Determines whether this converter can convert an Image to the specified type, using the specified context.

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
destinationTypeTypeThe Type to evaluate for conversion.

Returns: Boolean. if the conversion is possible; otherwise, .

Instance member ConvertFrom(context, culture, value)

Converts the given object to an Image object, using the specified context and culture information.

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
cultureCultureInfoThe CultureInfo to use during conversion.
valueObjectThe object to convert.

Returns: Object. An Image object, or if the conversion cannot be performed.

Throws:

Instance member ConvertTo(context, culture, value, destinationType)

Converts the given Image object to another type, using the specified context and culture information.

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
cultureCultureInfoThe CultureInfo to use during conversion.
valueObjectThe Image object to convert.
destinationTypeTypeThe Type to convert the object to.

Returns: Object. The converted object.

Throws:

Instance member GetProperties(context, value, attributes)

Retrieves the set of properties for the Image type. By default, this method returns the properties of the Image type.

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
valueObjectThe object to retrieve properties for.
attributesAttribute[]An array of Attribute objects to filter the properties.

Returns: PropertyDescriptorCollection. A PropertyDescriptorCollection containing the properties of the Image type.

Instance member GetPropertiesSupported(context)

Determines whether this object supports properties. This implementation always returns .

ParameterTypeDescription
contextITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.

Returns: Boolean. if properties are supported; otherwise, .