public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy) { using (var renderer = new SkiaShapeRenderer(_context, _view.SelectionState)) using (var background = SkiaHelper.ToSKPaintBrush(_view.PrintBackground, false)) { var canvas = context as SKCanvas; canvas.DrawRect(SkiaHelper.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background); _view.CurrentContainer.Draw(canvas, renderer, dx, dy, zx, null, null); } }
private void GetSKPaintFill(ArgbColor color, bool isAntialias, out SKPaint brush) { if (color.IsDirty == true || !_paintCache.TryGetValue(color, out var brushCached)) { color.Invalidate(); brushCached = SkiaHelper.ToSKPaintBrush(color, isAntialias); _paintCache[color] = brushCached; } else { SkiaHelper.ToSKPaintBrushUpdate(brushCached, color); } brush = brushCached; }
public void Draw(object context, double width, double height, double dx, double dy, double zx, double zy) { using (var renderer = new SkiaShapeRenderer(_context, _view.SelectionState)) using (var background = SkiaHelper.ToSKPaintBrush(_view.PrintBackground, false)) { var canvas = context as SKCanvas; canvas.DrawRect(SkiaHelper.ToSKRect(dx, dy, _view.Width + dx, _view.Height + dy), background); var selected = new List <IBaseShape>(_view.SelectionState?.Shapes); foreach (var shape in selected) { if (IsAcceptedShape(shape)) { shape.Draw(canvas, renderer, dx, dy, zx, null, null); } } } }