Skip to main content

ImageFormatConverter

Namespace: System.Drawing

Assembly: System.Drawing.Managed (4.0.0.0)

Provides a type converter to convert ImageFormat objects to and from various other representations, such as strings and instance descriptors.

public class ImageFormatConverter : TypeConverter

Constructors

Instance member ImageFormatConverter()

Initializes a new instance of ImageFormatConverter.

Methods

Instance member CanConvertFrom(context, sourceType)

Returns whether this converter can convert an object of the given type to an ImageFormat, using the specified context.

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.
sourceTypeTypeThe type to convert from.

Returns: Boolean. true if conversion is possible; otherwise, false.

Instance member CanConvertTo(context, destinationType)

Returns whether this converter can convert an ImageFormat to the specified destination type, using the given context.

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.
destinationTypeTypeThe type to convert to.

Returns: Boolean. true if conversion is possible; otherwise, false.

Instance member ConvertFrom(context, culture, value)

Converts the specified value to an ImageFormat object, using the provided context and culture information.

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.
cultureCultureInfoThe culture to use for conversion.
valueObjectThe value to convert.

Returns: Object. An ImageFormat object that represents the converted value.

Throws:

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

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

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.
cultureCultureInfoThe culture to use for conversion.
valueObjectThe ImageFormat object to convert.
destinationTypeTypeThe type to convert to.

Returns: Object. An object representing the converted value.

Throws:

Instance member GetStandardValues(context)

Returns a collection of standard ImageFormat values supported by this converter.

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.

Returns: StandardValuesCollection. A StandardValuesCollection containing the standard ImageFormat values, or null if the data type does not support a standard set of values.

Instance member GetStandardValuesSupported(context)

Returns whether this object supports a standard set of values that can be picked from a list.

ParameterTypeDescription
contextITypeDescriptorContextAn optional format context that can provide additional information.

Returns: Boolean. true if standard values are supported; otherwise, false.