IDrawingContextImplCreateLayer Method

Creates a new IRenderTargetBitmapImpl that can be used as a render layer for the current render target.

Definition

Namespace: Avalonia.Platform
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
IDrawingContextLayerImpl CreateLayer(
	PixelSize size
)

Parameters

size  PixelSize
The size of the layer in DIPs.

Return Value

IDrawingContextLayerImpl
An IRenderTargetBitmapImpl

Remarks

Depending on the rendering backend used, a layer created via this method may be more performant than a standard render target bitmap. In particular the Direct2D backend has to do a format conversion each time a standard render target bitmap is rendered, but a layer created via this method has no such overhead.

See Also