ImageFormatConverter
System.Drawing.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 : TypeConverterPublic Class ImageFormatConverter
Inherits TypeConverterConstructors
ImageFormatConverter()
Initializes a new instance of ImageFormatConverter.
Methods
CanConvertFrom(context, sourceType)
Returns whether this converter can convert an object of the given type to an ImageFormat, using the specified context.
Returns: Boolean. true if conversion is possible; otherwise, false.
CanConvertTo(context, destinationType)
Returns whether this converter can convert an ImageFormat to the specified destination type, using the given context.
Returns: Boolean. true if conversion is possible; otherwise, false.
ConvertFrom(context, culture, value)
Converts the specified value to an ImageFormat object, using the provided context and culture information.
Returns: Object. An ImageFormat object that represents the converted value.
Throws:
FormatException Thrown if the value cannot be converted to an ImageFormat.
ConvertTo(context, culture, value, destinationType)
Converts the given ImageFormat object to another type, using the specified context and culture information.
Returns: Object. An object representing the converted value.
Throws:
NotSupportedException Thrown if the conversion cannot be performed.
GetStandardValues(context)
Returns a collection of standard ImageFormat values supported by this converter.
Returns: StandardValuesCollection. A StandardValuesCollection containing the standard ImageFormat values, or null if the data type does not support a standard set of values.
GetStandardValuesSupported(context)
Returns whether this object supports a standard set of values that can be picked from a list.
Returns: Boolean. true if standard values are supported; otherwise, false.
Last updated
Was this helpful?