Table of Contents

Method GetColorContext

Namespace
PaintDotNet.FileTypes
Assembly
PaintDotNet.FileTypes.dll

GetColorContext()

Gets the color context that defines the color space of the document. If the document has a color profile defined in its metadata then this will provide access to that. A document always has a color context.

IColorContext GetColorContext()

Returns

IColorContext

Remarks

If a color context is not set when creating the document, then this will be the default color context of the document's PixelFormat (usually sRGB).

If your IFileType implementation already handles saving or loading metadata accessible through the Metadata property, there is probably no need to worry about this method or using the IColorContext interface. The color profile data will already be provided through the EXIF metadata section. Some image types can specify color space information more compactly (e.g. PNG's sRGB, iCCP, and cICP chunks) without needing to store the whole color profile, which may be worth implementing. For help with handling CICP, see CicpColorSpace.