コード例 #1
0
 //-----
 public void FillPath(SVGRadialGradientBrush radialGradientBrush, SVGColor?strokePathColor, SVGGraphicsPath graphicsPath)
 {
     BeginSubBuffer();
     graphicsPath.RenderPath(this, true);
     if (strokePathColor != null)
     {
         EndSubBuffer(radialGradientBrush, strokePathColor);
     }
     else
     {
         EndSubBuffer(radialGradientBrush);
     }
 }
コード例 #2
0
ファイル: SVGBasicElement.cs プロジェクト: grrava/UnitySVG
        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;
            }
            }
        }
コード例 #3
0
ファイル: SVGGraphicsFill.cs プロジェクト: xpcrts/UnitySVG
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush)
    {
        PreEndSubBuffer();

        for (int i = inZoneL; i < subW + inZoneL; i++)
        {
            for (int j = inZoneT; j < subH + inZoneT; j++)
            {
                if (flag[i, j] == 0)
                {
                    Color _color = radialGradientBrush.GetColor(i, j);
                    graphics.SetColor(_color);
                    graphics.SetPixel(i, j);
                }
            }
        }
    }
コード例 #4
0
    //Fill Radial Gradient, no fill Stroke
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush)
    {
        PreEndSubBuffer();

        for (int i = this._inZoneL; i < this._subW + this._inZoneL; i++)
        {
            for (int j = this._inZoneT; j < this._subH + this._inZoneT; j++)
            {
                if (this._flag[i, j] == 0)
                {
                    Color _color = radialGradientBrush.GetColor(i, j);
                    this._graphics.SetColor(_color);
                    this._graphics.SetPixel(i, j);
                }
            }
        }
    }
コード例 #5
0
ファイル: SVGGraphicsFill.cs プロジェクト: xpcrts/UnitySVG
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush, SVGColor?strokePathColor)
    {
        PreEndSubBuffer();

        for (int i = inZoneL; i < subW + inZoneL; ++i)
        {
            for (int j = inZoneT; j < subH + inZoneT; ++j)
            {
                if (flag[i, j] != FILL_FLAG)
                {
                    Color _color = radialGradientBrush.GetColor(i, j);
                    graphics.SetColor(_color);
                    graphics.SetPixel(i, j);
                }
            }
        }

        graphics.SetColor(strokePathColor.Value.color);

        FillInZone();
    }
コード例 #6
0
    //Fill Radial Gradient, with fill Stroke
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush, SVGColor?strokePathColor)
    {
        PreEndSubBuffer();

        for (int i = this._inZoneL; i < this._subW + this._inZoneL; i++)
        {
            for (int j = this._inZoneT; j < this._subH + this._inZoneT; j++)
            {
                if (this._flag[i, j] != -1)
                {
                    Color _color = radialGradientBrush.GetColor(i, j);
                    this._graphics.SetColor(_color);
                    this._graphics.SetPixel(i, j);
                }
            }
        }

        this._graphics.SetColor(strokePathColor.Value.color);

        FillInZone();
    }
コード例 #7
0
    //Fill khong co Stroke, va ve stroke sau
    public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                         SVGColor?strokePathColor,
                         float width,
                         SVGGraphicsPath graphicsPath)
    {
        graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
        if ((int)width == 1)
        {
            graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
        }
        else
        {
            graphicsFill.FillPath(radialGradientBrush, graphicsPath);
        }

        if (strokePathColor == null)
        {
            return;
        }
        SetColor(strokePathColor.Value.color);
        //graphicsPath.RenderPath(this, width, false);
    }
コード例 #8
0
 //--------------------------------------------------------------------------------
 //Path Radial Gradient Fill
 //--------------------------------------------------------------------------------
 //Fill khong to Stroke
 public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                             SVGGraphicsPath graphicsPath)
 {
     this._graphicsFill.FillPath(radialGradientBrush, graphicsPath);
 }
コード例 #9
0
ファイル: SVGGraphicsFill.cs プロジェクト: MrJoy/UnitySVG
 public void FillPath(SVGRadialGradientBrush radialGradientBrush, SVGColor? strokePathColor,
                    SVGGraphicsPath graphicsPath)
 {
     ResetSubBuffer();
     graphicsPath.RenderPath(this, true);
     if(strokePathColor != null)
       EndSubBuffer(radialGradientBrush, strokePathColor);
     else
       EndSubBuffer(radialGradientBrush);
 }
コード例 #10
0
ファイル: SVGGraphicsFill.cs プロジェクト: MrJoy/UnitySVG
 public void FillPath(SVGRadialGradientBrush radialGradientBrush, SVGGraphicsPath graphicsPath)
 {
     ResetSubBuffer();
     graphicsPath.RenderPath(this, true);
     EndSubBuffer(radialGradientBrush);
 }
コード例 #11
0
ファイル: SVGGraphicsFill.cs プロジェクト: MrJoy/UnitySVG
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush, SVGColor? strokePathColor)
    {
        PreEndSubBuffer();

        for(int i = inZoneL; i < subW + inZoneL; ++i) {
          for(int j = inZoneT; j < subH + inZoneT; ++j) {
        if(flag[i, j] != FILL_FLAG) {
          Color _color = radialGradientBrush.GetColor(i, j);
          graphics.SetColor(_color);
          graphics.SetPixel(i, j);
        }
          }
        }

        graphics.SetColor(strokePathColor.Value.color);

        FillInZone();
    }
コード例 #12
0
ファイル: SVGGraphicsFill.cs プロジェクト: MrJoy/UnitySVG
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush)
    {
        PreEndSubBuffer();

        for(int i = inZoneL; i < subW + inZoneL; i++) {
          for(int j = inZoneT; j < subH + inZoneT; j++) {
        if(flag[i, j] == 0) {
          Color _color = radialGradientBrush.GetColor(i, j);
          graphics.SetColor(_color);
          graphics.SetPixel(i, j);
        }
          }
        }
    }
コード例 #13
0
ファイル: SVGGraphicsFill.cs プロジェクト: pjezek/UnitySVG
    //Fill Radial Gradient, with fill Stroke
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush, SVGColor? strokePathColor)
    {
        PreEndSubBuffer();

        for(int i = this._inZoneL; i < this._subW + this._inZoneL; i++) {
          for(int j = this._inZoneT; j < this._subH + this._inZoneT; j++) {
        if(this._flag[i, j] != -1) {
          Color _color = radialGradientBrush.GetColor(i, j);
          this._graphics.SetColor(_color);
          this._graphics.SetPixel(i, j);
        }
          }
        }

        this._graphics.SetColor(strokePathColor.Value.color);

        for(int i = this._inZoneL; i < this._subW + this._inZoneL; i++)
          for(int j = this._inZoneT; j < this._subH + this._inZoneT; j++)
        if(this._flag[i, j] > 0)
          this._graphics.SetPixel(i, j);
    }
コード例 #14
0
ファイル: SVGGraphicsFill.cs プロジェクト: pjezek/UnitySVG
    //Fill Radial Gradient, no fill Stroke
    public void EndSubBuffer(SVGRadialGradientBrush radialGradientBrush)
    {
        PreEndSubBuffer();

        for(int i = this._inZoneL; i < this._subW + this._inZoneL; i++) {
          for(int j = this._inZoneT; j < this._subH + this._inZoneT; j++) {
        if(this._flag[i, j] == 0) {
          Color _color = radialGradientBrush.GetColor(i, j);
          this._graphics.SetColor(_color);
          this._graphics.SetPixel(i, j);
        }
          }
        }
    }
コード例 #15
0
 //-----
 //Fill co Stroke trong do luon
 public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                           SVGColor? strokePathColor,
                           SVGGraphicsPath graphicsPath)
 {
     this._graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
 }
コード例 #16
0
 //Fill khong to Stroke
 public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                      SVGGraphicsPath graphicsPath)
 {
     graphicsFill.FillPath(radialGradientBrush, graphicsPath);
 }
コード例 #17
0
 //Fill co Stroke trong do luon
 public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                      SVGColor?strokePathColor,
                      SVGGraphicsPath graphicsPath)
 {
     graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
 }
コード例 #18
0
    //-----
    //Fill khong co Stroke, va ve stroke sau
    public void FillPath(SVGRadialGradientBrush radialGradientBrush,
                              SVGColor? strokePathColor,
                              float width,
                              SVGGraphicsPath graphicsPath)
    {
        this._graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
        if((int)width == 1)
          this._graphicsFill.FillPath(radialGradientBrush, strokePathColor, graphicsPath);
        else this._graphicsFill.FillPath(radialGradientBrush, graphicsPath);

        if(strokePathColor == null)return;
        SetColor(strokePathColor.Value.color);
        //graphicsPath.RenderPath(this, width, false);
    }
コード例 #19
0
ファイル: SVGGraphicsFill.cs プロジェクト: xpcrts/UnitySVG
 public void FillPath(SVGRadialGradientBrush radialGradientBrush, SVGGraphicsPath graphicsPath)
 {
     ResetSubBuffer();
     graphicsPath.RenderPath(this, true);
     EndSubBuffer(radialGradientBrush);
 }