PeachDrawing.Core

PeachDrawing.Core.Canvas

Canvas.BeginLayer(LayerOptions) Method

Begins an isolated group of drawing that is composited onto this canvas as one piece when the returned layer is disposed: with the given opacity, blend mode and colour transform applied to the group as a whole rather than to each shape in it. This is what CSS opacity or SVG group opacity means - content that overlaps inside the group does not blend with itself. Draw onto Canvas in this canvas’s own coordinates.

public virtual PeachDrawing.Core.CanvasLayer? BeginLayer(PeachDrawing.Core.LayerOptions options);

Parameters

options LayerOptions

how the finished layer is composited, and the region it covers

Returns

CanvasLayer
the layer, or null when this canvas cannot make one (as with CreateTile(double, double), e.g. a measure-only pass); the caller then draws straight onto this canvas, where opacity and blending have no visible effect anyway

Remarks

The default builds the layer from CreateTile(double, double) and the DrawImage… methods, so it works on any canvas. A canvas that can composite a group more directly overrides it.