ID2D1EffectContext::CreateColorContext method (d2d1effectauthor.h)

Creates a color context from a color space.

If the color space is Custom, the context is initialized from the profile and profileSize parameters.

If the color space is not Custom, the context is initialized with the profile bytes associated with the color space. The profile and profileSize parameters are ignored.


HRESULT CreateColorContext(
                 D2D1_COLOR_SPACE  space,
  [in, optional] const BYTE        *profile,
                 UINT32            profileSize,
  [out]          ID2D1ColorContext **colorContext




The space of color context to create.

[in, optional] profile

Type: const BYTE*

A buffer containing the ICC profile bytes used to initialize the color context when space is D2D1_COLOR_SPACE_CUSTOM. For other types, the parameter is ignored and should be set to NULL.


Type: UINT32

The size in bytes of Profile.

[out] colorContext

Type: ID2D1ColorContext**

When this method returns, contains the address of a pointer to a new color context object.

Return value


The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULT Description
S_OK No error occurred.
E_OUTOFMEMORY Direct2D could not allocate sufficient memory to complete the call.
E_INVALIDARG An invalid value was passed to the method.


Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1effectauthor.h
Library D2d1.lib
DLL D2d1.dll

See also