# RasterImageFormatExtensions

Provides metadata helpers for opaque raster image formats.

 Class  

`ChartForgeX.Core`

**Namespace**

`ChartForgeX.Core`

**Assembly**

`ChartForgeX`

**Source**

[RasterImageFormatExtensions.cs:15](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L15)

**Modifiers**

static

Provides metadata helpers for opaque raster image formats.

## Inheritance

- object
- RasterImageFormatExtensions

 Filter members   

    Show inherited   

 

## Methods

 `public static RasterImageFormat FromFileExtension(string pathOrExtension)` [#](#method-fromfileextension-string) 

[RasterImageFormatExtensions.cs:88](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L88)

Resolves a raster image format from a file extension or file path.

Parameters

**pathOrExtension string required**

A file extension such as ".bmp" or "bmp", or a file path ending in a supported extension.

Returns

 `RasterImageFormat` The resolved raster image format. 

 `public static string GetFileExtension(RasterImageFormat format)` [#](#method-getfileextension-chartforgex-core-rasterimageformat) 

[RasterImageFormatExtensions.cs:102](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L102)

Gets the conventional file extension for the raster image format.

Parameters

**format ChartForgeX.Core.RasterImageFormat required**

The raster image format.

Returns

 `string` The lowercase file extension, including the leading dot. 

 `public static string[] GetFileExtensions(RasterImageFormat format)` [#](#method-getfileextensions-chartforgex-core-rasterimageformat) 

[RasterImageFormatExtensions.cs:124](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L124)

Gets all recognized file extensions for the raster image format.

Parameters

**format ChartForgeX.Core.RasterImageFormat required**

The raster image format.

Returns

 `string[]` Lowercase file extensions, including leading dots, with the conventional extension first. 

 `public static string GetMimeType(RasterImageFormat format)` [#](#method-getmimetype-chartforgex-core-rasterimageformat) 

[RasterImageFormatExtensions.cs:146](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L146)

Gets the MIME type for the raster image format.

Parameters

**format ChartForgeX.Core.RasterImageFormat required**

The raster image format.

Returns

 `string` The MIME content type. 

 `public static RasterImageFormat[] GetSupportedFormats()` [#](#method-getsupportedformats) 

[RasterImageFormatExtensions.cs:15](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L15)

Gets the supported opaque raster image formats in a stable display order.

Returns

 `RasterImageFormat[]` A new array containing the supported raster image formats. 

 `public static bool IsSupported(RasterImageFormat format)` [#](#method-issupported-chartforgex-core-rasterimageformat) 

[RasterImageFormatExtensions.cs:36](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L36)

Determines whether the raster image format is currently supported.

Parameters

**format ChartForgeX.Core.RasterImageFormat required**

The raster image format.

Returns

 `bool` True when the format can be encoded; otherwise, false. 

 `public static bool TryFromFileExtension(string? pathOrExtension, out RasterImageFormat format)` [#](#method-tryfromfileextension-string-chartforgex-core-rasterimageformat) 

[RasterImageFormatExtensions.cs:49](https://github.com/EvotecIT/ChartForgeX/blob/main/ChartForgeX/Core/RasterImageFormatExtensions.cs#L49)

Attempts to resolve a raster image format from a file extension or file path.

Parameters

**pathOrExtension string? required**

A file extension such as ".bmp" or "bmp", or a file path ending in a supported extension.

**format ChartForgeX.Core.RasterImageFormat required**

The resolved raster image format when the method returns true.

Returns

 `bool` True when the extension is supported; otherwise, false. 

## Inherited Methods

 `public virtual bool Equals(object? obj)` [#](#method-equals-object) 

Inherited from object

Parameters

**obj object? required**

Returns

 `bool` 

 `public virtual int GetHashCode()` [#](#method-gethashcode) 

Inherited from object

Returns

 `int` 

 `public Type GetType()` [#](#method-gettype) 

Inherited from object

Returns

 `Type` 

 `public virtual string? ToString()` [#](#method-tostring) 

Inherited from object

Returns

 `string?` 

<!-- PowerForge markdown artifact sha256:5CE9DEA70B9696470F2B7771DE788DDB8F0A1C0E1EC1B05C6908C752F82E361D -->
