public override IBrush GetBrush(byte alpha) { if (_canvasLinearGradientBrush == null) { var startPoint = new Vector((float)_x0, (float)_y0); var endPoint = new Vector((float)_x1, (float)_y1); startPoint = LocalMatrix.Transform(startPoint); endPoint = LocalMatrix.Transform(endPoint); _canvasLinearGradientBrush = new ImmutableLinearGradientBrush(_canvasGradientStopCollection, alpha / 255f, startPoint: new RelativePoint(startPoint.X, startPoint.Y, RelativeUnit.Relative), endPoint: new RelativePoint(endPoint.X, endPoint.Y, RelativeUnit.Relative)); } return(_canvasLinearGradientBrush); }
public void Dispose() { _canvasLinearGradientBrush = null; }