ID2D1EffectContext::CreateColorContext method

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.

Syntax


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

Parameters

space

Type: D2D1_COLOR_SPACE

The space of color context to create.

profile [in, optional]

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.

profileSize

Type: UINT32

The size in bytes of Profile.

colorContext [out]

Type: ID2D1ColorContext**

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

Return value

Type: HRESULT

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

HRESULTDescription
S_OKNo error occurred.
E_OUTOFMEMORYDirect2D could not allocate sufficient memory to complete the call.
E_INVALIDARGAn invalid value was passed to the method.

 

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1effectauthor.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ID2D1EffectContext

 

 

Community Additions

ADD
Show:
© 2014 Microsoft