ImageConverter
ImageConverter is a class that can be used to convert Image objects from one data type to another. Access this class through the TypeDescriptor object.
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
namespace System.Drawing
{
[System.Runtime.CompilerServices.NullableContext(2)]
[System.Runtime.CompilerServices.Nullable(0)]
public class ImageConverter : TypeConverter
{
public ImageConverter()
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
[System.Runtime.CompilerServices.NullableContext(1)]
public override bool CanConvertFrom([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context, Type sourceType)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
public override bool CanConvertTo(ITypeDescriptorContext context, [System.Diagnostics.CodeAnalysis.NotNullWhen(true)] Type destinationType)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, [System.Runtime.CompilerServices.Nullable(1)] object value)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
[return: System.Runtime.CompilerServices.Nullable(1)]
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, [System.Runtime.CompilerServices.Nullable(1)] Type destinationType)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
[return: System.Runtime.CompilerServices.Nullable(1)]
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
1
})] Attribute[] attributes)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported);
}
}
}