ImageFormat 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定图像的文件格式。 不可继承。
public ref class ImageFormat sealedpublic sealed class ImageFormat[System.ComponentModel.TypeConverter("System.Drawing.ImageFormatConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")]
public sealed class ImageFormat[System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageFormatConverter))]
public sealed class ImageFormattype ImageFormat = class[<System.ComponentModel.TypeConverter("System.Drawing.ImageFormatConverter, System.Windows.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51")>]
type ImageFormat = class[<System.ComponentModel.TypeConverter(typeof(System.Drawing.ImageFormatConverter))>]
type ImageFormat = classPublic NotInheritable Class ImageFormat- 继承
- 
				ImageFormat
- 属性
注解
类的属性 ImageFormat 指示位图 () Bmp 、增强的图元文件 () Emf 和图标 (Icon) 等图像格式。 例如,在使用 方法保存图像时,可以使用 类的属性 ImageFormat 指定图像 Save 格式。 可以使用 方法比较两种图像格式 Equals 。
注意
在 .NET 6 及更高版本中, System.Drawing.Common 包(包括此类型)仅在 Windows 操作系统上受支持。 在跨平台应用中使用此类型会导致编译时警告和运行时异常。 有关详细信息,请参阅 仅在 Windows 上支持 System.Drawing.Common。
构造函数
| ImageFormat(Guid) | 使用指定的 ImageFormat 结构初始化 Guid 类的新实例。 | 
属性
| Bmp | 获取位图 (BMP) 图像格式。 | 
| Emf | 获取增强型图元文件 (WMF) 图像格式。 | 
| Exif | 获取可交换图像文件 (Exif) 格式。 | 
| Gif | 获取图形交换格式 (GIF) 图像格式。 | 
| Guid | 获取表示此 Guid 对象的 ImageFormat 结构。 | 
| Heif | 指定 HEIF) (高效图像格式。 | 
| Icon | 获取 Windows 图标图像格式。 | 
| Jpeg | 获取联合图像专家组 (JPEG) 图像格式。 | 
| MemoryBmp | 获取内存中的位图的格式。 | 
| Png | 获取 W3C 可移植网络图形 (PNG) 图像格式。 | 
| Tiff | 获取标记图像文件格式 (TIFF) 图像格式。 | 
| Webp | 指定 WebP 图像格式。 | 
| Wmf | 获取 Windows 图元文件 (WMF) 图像格式。 | 
方法
| Equals(Object) | 返回一个值,指示指定的对象是否是等效于此 ImageFormat 对象的 ImageFormat 对象。 | 
| GetHashCode() | 返回一个表示此对象的哈希代码值。 | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 将此 ImageFormat 对象转换为可读的字符串。 |