Table of Contents

Method PushLayer

Namespace
PaintDotNet.Direct2D1
Assembly
PaintDotNet.Windows.dll

PushLayer(in LayerParameters, IDeviceLayer?)

Push a layer onto the clip and layer stack of the device context. The layer will receive all subequent drawing operations until PopLayer() is called.
See Direct2D Layers Overview for more information.

void PushLayer(in LayerParameters layerParameters, IDeviceLayer? layer = null)

Parameters

layerParameters LayerParameters

The parameters that defines the layer.

layer IDeviceLayer

The layer that receives subsequent drawing operations. It is recommended that you pass null.

Remarks

The PushLayer method allows a caller to begin redirecting rendering to a layer. All rendering operations are valid in a layer. The location of the layer is affected by the world transform set on the device context.
Each PushLayer must have a matching PopLayer call. If there are more PopLayer calls than PushLayer calls, the device context is placed into an error state. If Flush is called before all outstanding layers are popped, the render target is placed into an error state, and an exception is thrown. The error state can be cleared by a call to EndDraw.