Method CreateColorContext
- Namespace
- PaintDotNet.Direct2D1
- Assembly
- PaintDotNet.Windows.dll
CreateColorContext(DeviceColorSpace)
Creates a color context.
IDeviceColorContext CreateColorContext(DeviceColorSpace space)
Parameters
spaceDeviceColorSpaceThe space of color context to create.
Returns
- IDeviceColorContext
The new color context object.
Remarks
The new color context can be used in BitmapProperties to initialize the color context of a created bitmap,
or with the Color Management effect.
CreateColorContext(ReadOnlySpan<byte>)
Creates a color context.
IDeviceColorContext CreateColorContext(ReadOnlySpan<byte> customProfile)
Parameters
customProfileReadOnlySpan<byte>A buffer containing the ICC profile bytes used to initialize the color context.
Returns
- IDeviceColorContext
The new color context object.
Remarks
The new color context can be used in BitmapProperties to initialize the color context of a created bitmap,
or with the Color Management effect.
The model field of the profile header is inspected to determine if this profile is sRGB or scRGB and the color space is updated respectively. Otherwise the space remains custom.
CreateColorContext(IColorContext)
Creates a color context from an IColorContext. The color space of the resulting context varies, see Remarks for more info.
IDeviceColorContext CreateColorContext(IColorContext colorContext)
Parameters
colorContextIColorContextThe IColorContext used to initialize the color context.
Returns
- IDeviceColorContext
The new color context.
Remarks
The new color context can be used in BitmapProperties to initialize the color context of a created bitmap,
or with the Color Management effect.
The model field of the profile header is inspected to determine if this profile is sRGB or scRGB and the color space is updated respectively. Otherwise the space remains custom.
CreateColorContext(DxgiColorSpace)
Creates a color context from a DXGI color space type. It is only valid to use this with the Color Management Effect in 'Best' mode.
IDeviceColorContext CreateColorContext(DxgiColorSpace colorSpace)
Parameters
colorSpaceDxgiColorSpaceThe color space to create the color context from.
Returns
- IDeviceColorContext
The created color context.
CreateColorContext(SimpleColorProfile)
Creates a color context from a simple color profile. It is only valid to use this with the Color Management Effect in 'Best' mode.
IDeviceColorContext CreateColorContext(SimpleColorProfile simpleProfile)
Parameters
simpleProfileSimpleColorProfileThe simple color profile to create the color context from.
Returns
- IDeviceColorContext
The created color context.