PeachDrawing.Core

PeachDrawing.Core.Canvas

Canvas.DrawImageWithOpacity(Image, Rect, double, PaintBlendMode) Method

Draws image (a tile from CreateTile(double, double)) at destRect, composited as a single flattened result at constant opacity - the mechanism behind CSS/SVG group opacity. Unlike simply multiplying the alpha of each shape painted into the tile, this flattens the tile’s own (possibly overlapping) content once before applying opacity to the flattened result, so overlapping content doesn’t double-darken where it overlaps. A no-op if image wasn’t created via CreateTile(double, double) on this same Canvas. blendMode composites the flattened tile against the destination with a non-Normal PDF blend mode in the same gs as opacity - the mechanism behind CSS mix-blend-mode combined with group opacity, a single ExtGState rather than two nested ones.

public abstract void DrawImageWithOpacity(PeachDrawing.Core.Image image, PeachDrawing.Core.Rect destRect, double opacity, PeachDrawing.Core.PaintBlendMode blendMode=PeachDrawing.Core.PaintBlendMode.Normal);

Parameters

image Image

destRect Rect

opacity System.Double

blendMode PaintBlendMode