ImageConverter

System.Drawing.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

ImageConverter()

Initializes a new instance of ImageConverter.

Methods

CanConvertFrom(context, sourceType)

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

Parameter
Type
Description

sourceType

The Typearrow-up-right to evaluate for conversion.

Returns: Booleanarrow-up-right. if the conversion is possible; otherwise, .

CanConvertTo(context, destinationType)

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

Parameter
Type
Description

destinationType

The Typearrow-up-right to evaluate for conversion.

Returns: Booleanarrow-up-right. if the conversion is possible; otherwise, .

ConvertFrom(context, culture, value)

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

Parameter
Type
Description

culture

The CultureInfoarrow-up-right to use during conversion.

value

The object to convert.

Returns: Objectarrow-up-right. An Image object, or if the conversion cannot be performed.

Throws:

ConvertTo(context, culture, value, destinationType)

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

Parameter
Type
Description

culture

The CultureInfoarrow-up-right to use during conversion.

value

The Image object to convert.

destinationType

The Typearrow-up-right to convert the object to.

Returns: Objectarrow-up-right. The converted object.

Throws:

GetProperties(context, value, attributes)

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

Parameter
Type
Description

value

The object to retrieve properties for.

attributes

An array of Attributearrow-up-right objects to filter the properties.

Returns: PropertyDescriptorCollectionarrow-up-right. A PropertyDescriptorCollectionarrow-up-right containing the properties of the Image type.

GetPropertiesSupported(context)

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

Parameter
Type
Description

Returns: Booleanarrow-up-right. if properties are supported; otherwise, .

Last updated

Was this helpful?