SVGPaintable.GetLinearGradientBrush C# (CSharp) Method

GetLinearGradientBrush() public method

public GetLinearGradientBrush ( SVGGraphicsPath, graphicsPath ) : SVGLinearGradientBrush,
graphicsPath SVGGraphicsPath,
return SVGLinearGradientBrush,
    public SVGLinearGradientBrush GetLinearGradientBrush(SVGGraphicsPath graphicsPath)
    {
        for(int i = 0; i < _linearGradList.Count; i++) {
          if(_linearGradList[i].id == _gradientID)
        return new SVGLinearGradientBrush(_linearGradList[i], graphicsPath);
        }
        return null;
    }

Usage Example

Exemplo n.º 1
0
        public void Render()
        {
            CreateGraphicsPath();
            _render.SetStrokeLineCap(_paintable.strokeLineCap);
            _render.SetStrokeLineJoin(_paintable.strokeLineJoin);
            switch (_paintable.GetPaintType())
            {
            case SVGPaintMethod.SolidGradientFill:
            {
                _render.FillPath(_paintable.fillColor.Value, _graphicsPath);
                Draw();
                break;
            }

            case SVGPaintMethod.LinearGradientFill:
            {
                SVGLinearGradientBrush _linearGradBrush =
                    _paintable.GetLinearGradientBrush(_graphicsPath);

                if (_linearGradBrush != null)
                {
                    _render.FillPath(_linearGradBrush, _graphicsPath);
                }
                Draw();
                break;
            }

            case SVGPaintMethod.RadialGradientFill:
            {
                SVGRadialGradientBrush _radialGradBrush =
                    _paintable.GetRadialGradientBrush(_graphicsPath);

                if (_radialGradBrush != null)
                {
                    _render.FillPath(_radialGradBrush, _graphicsPath);
                }
                Draw();
                break;
            }

            case SVGPaintMethod.PathDraw:
            {
                Draw();
                break;
            }
            }
        }