Beispiel #1
0
        public override IBrush GetBrush(byte alpha)
        {
            if (_canvasRadialGradientBrush == null)
            {
                var center = new Vector2(_x0, _y0);
                center = LocalMatrix.Transform(center);

                //
                // var properties = new RadialGradientBrushProperties
                // {
                //     RadiusX = _r,
                //     RadiusY = _r,
                //     Center = center
                // };
                //
                // var collection = new GradientStopCollection(renderTarget, _canvasGradientStopCollection, Gamma.Linear, ExtendMode.Clamp);
                // //TODO: OID: property missed, Same for Linear
                //

                _canvasRadialGradientBrush = new RadialGradientBrush
                {
                    Radius        = _r,
                    Center        = new RelativePoint(center.X, center.Y, RelativeUnit.Relative),
                    GradientStops = _canvasGradientStopCollection
                };
            }

            _canvasRadialGradientBrush.Opacity = alpha / 255f;

            return(_canvasRadialGradientBrush.ToImmutable());
        }