CreateLayer Method (D2D1_SIZE_F,ID2D1Layer**)
Collapse the table of content
Expand the table of content

ID2D1RenderTarget::CreateLayer method

Creates a layer resource that can be used with this render target and its compatible render targets. The new layer has the specified initial size.

Syntax


HRESULT CreateLayer(
        D2D1_SIZE_F size,
  [out] ID2D1Layer  **layer
);

Parameters

size

Type: D2D1_SIZE_F

If (0, 0) is specified, no backing store is created behind the layer resource. The layer resource is allocated to the minimum size when PushLayer is called.

layer [out]

Type: 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

Regardless of whether a size is initially specified, the layer automatically resizes as needed.

Examples

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

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

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

Header

D2d1.h

Library

D2d1.lib

DLL

D2d1.dll

See also

Layers Overview
ID2D1RenderTarget

 

 

Show:
© 2016 Microsoft