Click or drag to resize
CanvasDrawingSession.CreateLayer Method (Single, ICanvasBrush, Rect, CanvasGeometry, Matrix3x2, CanvasLayerOptions)
Creates a layer that will clip its contents to a rectangle and/or geometry region, and blend using the specified opacity and/or opacity mask brush.

Namespace:  Microsoft.Graphics.Canvas
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public CanvasActiveLayer CreateLayer(
	float opacity,
	ICanvasBrush opacityBrush,
	Rect clipRectangle,
	CanvasGeometry clipGeometry,
	Matrix3x2 geometryTransform,
	CanvasLayerOptions options
)

Parameters

opacity
Type: System.Single
opacityBrush
Type: Microsoft.Graphics.Canvas.Brushes.ICanvasBrush
clipRectangle
Type: Windows.Foundation.Rect
clipGeometry
Type: Microsoft.Graphics.Canvas.Geometry.CanvasGeometry
geometryTransform
Type: System.Numerics.Matrix3x2
options
Type: Microsoft.Graphics.Canvas.CanvasLayerOptions

Return Value

Type: CanvasActiveLayer
Remarks

The layer affects all drawing until the returned CanvasActiveLayer object is closed. In C# this is typically done with a 'using' statement, or in C++/CX the 'delete' keyword.

Antialising mode of the clip geometry is determined by the value of the Antialiasing property when CreateLayer is called.

For more information about layers, see CanvasActiveLayer.

See Also