<PackageReference Include="System.Drawing.Common" Version="9.0.5" />

ImageFormatConverter

ImageFormatConverter is a class that can be used to convert ImageFormat 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 ImageFormatConverter : TypeConverter { public ImageFormatConverter() { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool CanConvertFrom(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); } 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.Runtime.CompilerServices.NullableContext(1)] public override StandardValuesCollection GetStandardValues([System.Runtime.CompilerServices.Nullable(2)] ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { throw new PlatformNotSupportedException(System.SR.SystemDrawingCommon_PlatformNotSupported); } } }