Class
RasterImageFormatExtensions
ChartForgeX.Core
Provides metadata helpers for opaque raster image formats.
Inheritance
- object
- RasterImageFormatExtensions
Methods
public static RasterImageFormat FromFileExtension(string pathOrExtension) #Resolves a raster image format from a file extension or file path.
Parameters
- pathOrExtension string
- A file extension such as ".bmp" or "bmp", or a file path ending in a supported extension.
public static string GetFileExtension(RasterImageFormat format) #Gets the conventional file extension for the raster image format.
Parameters
- format ChartForgeX.Core.RasterImageFormat
- The raster image format.
Returns
string The lowercase file extension, including the leading dot.public static string[] GetFileExtensions(RasterImageFormat format) #Gets all recognized file extensions for the raster image format.
Parameters
- format ChartForgeX.Core.RasterImageFormat
- The raster image format.
Returns
string[] Lowercase file extensions, including leading dots, with the conventional extension first.public static string GetMimeType(RasterImageFormat format) #Gets the MIME type for the raster image format.
Parameters
- format ChartForgeX.Core.RasterImageFormat
- The raster image format.
Returns
string The MIME content type.public static RasterImageFormat[] GetSupportedFormats() #Gets the supported opaque raster image formats in a stable display order.
public static bool IsSupported(RasterImageFormat format) #Determines whether the raster image format is currently supported.
Parameters
- format ChartForgeX.Core.RasterImageFormat
- The raster image format.
Returns
bool True when the format can be encoded; otherwise, false.public static bool TryFromFileExtension(string? pathOrExtension, out RasterImageFormat format) #Attempts to resolve a raster image format from a file extension or file path.
Parameters
- pathOrExtension string?
- A file extension such as ".bmp" or "bmp", or a file path ending in a supported extension.
- format ChartForgeX.Core.RasterImageFormat
- The resolved raster image format when the method returns true.
Returns
bool True when the extension is supported; otherwise, false.