ID2D1RenderTarget::CreateLayer(ID2D1Layer**) method (d2d1.h)

Creates a layer resource that can be used with this render target and its compatible render targets.

Syntax

HRESULT CreateLayer(
  ID2D1Layer **layer
);

Parameters

layer

Type: [out] ID2D1Layer**

When the method returns, contains a pointer to a pointer to the new layer. This parameter is passed uninitialized.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The layer automatically resizes itself, as needed.

Examples

For an example on how to use CreateLayer, see the How to Clip a Region with a Layer.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1.h
Library D2d1.lib
DLL D2d1.dll

See also

ID2D1RenderTarget

Layers Overview