当前位置: 首页>>代码示例>>C#>>正文


C# SVGGraphicsPath.AddCubicCurveTo方法代码示例

本文整理汇总了C#中SVGGraphicsPath.AddCubicCurveTo方法的典型用法代码示例。如果您正苦于以下问题:C# SVGGraphicsPath.AddCubicCurveTo方法的具体用法?C# SVGGraphicsPath.AddCubicCurveTo怎么用?C# SVGGraphicsPath.AddCubicCurveTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SVGGraphicsPath的用法示例。


在下文中一共展示了SVGGraphicsPath.AddCubicCurveTo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CubicCurveTo

    //-----
    public void CubicCurveTo(Vector2 p1, Vector2 p2, Vector2 p, float width)
    {
        Vector2 _point = Vector2.zero;
        _point = _basicDraw.currentPoint;

        Vector2 _p1 = Vector2.zero;
        Vector2 _p2 = Vector2.zero;
        Vector2 _p3 = Vector2.zero;
        Vector2 _p4 = Vector2.zero;

        bool temp;
        temp = _graphics.GetThickLine(_point, p1, width, ref _p1, ref _p2, ref _p3, ref _p4);
        if (temp == false)
        {
            QuadraticCurveTo(p2, p, width);
            return;
        }

        Vector2 _p5 = Vector2.zero;
        Vector2 _p6 = Vector2.zero;
        Vector2 _p7 = Vector2.zero;
        Vector2 _p8 = Vector2.zero;

        _graphics.GetThickLine(p1, p2, width, ref _p5, ref _p6, ref _p7, ref _p8);

        Vector2 _p9 = Vector2.zero;
        Vector2 _p10 = Vector2.zero;
        Vector2 _p11 = Vector2.zero;
        Vector2 _p12 = Vector2.zero;

        _graphics.GetThickLine(p2, p, width, ref _p9, ref _p10, ref _p11, ref _p12);

        Vector2 _cp1, _cp2, _cp3, _cp4;
        _cp1 = _graphics.GetCrossPoint(_p1, _p3, _p5, _p7);
        _cp2 = _graphics.GetCrossPoint(_p2, _p4, _p6, _p8);
        _cp3 = _graphics.GetCrossPoint(_p5, _p7, _p9, _p11);
        _cp4 = _graphics.GetCrossPoint(_p6, _p8, _p10, _p12);

        _basicDraw.MoveTo(_point);
        _basicDraw.CubicCurveTo(p1, p2, p);

        SVGGraphicsPath _graphicsPath = new SVGGraphicsPath();
        _graphicsPath.AddMoveTo(_p2);
        _graphicsPath.AddCubicCurveTo(_cp2, _cp4, _p12);
        _graphicsPath.AddLineTo(_p11);
        _graphicsPath.AddCubicCurveTo(_cp3, _cp1, _p1);
        _graphicsPath.AddLineTo(_p2);
        _graphics.FillPath(_graphicsPath);

        MoveTo(p);
    }
开发者ID:grrava,项目名称:UnitySVG,代码行数:52,代码来源:SVGGraphicsStroke.cs

示例2: Render

 //--------------------------------------------------------------------------------
 //Method: Render
 //--------------------------------------------------------------------------------
 public void Render(SVGGraphicsPath _graphicsPath)
 {
     SVGPoint p, p1, p2;
     p1 = controlPoint1;
     p2 = controlPoint2;
     p = currentPoint;
     _graphicsPath.AddCubicCurveTo(p1, p2, p);
 }
开发者ID:pjezek,项目名称:UnitySVG,代码行数:11,代码来源:SVGPathSegCurvetoCubicSmoothAbs.cs

示例3: Render

 public void Render(SVGGraphicsPath _graphicsPath)
 {
     _graphicsPath.AddCubicCurveTo(controlPoint1, controlPoint2, currentPoint);
 }
开发者ID:MrJoy,项目名称:UnitySVG,代码行数:4,代码来源:SVGPathSegCurvetoCubicSmoothAbs.cs

示例4: CubicCurveTo

    //-----
    public void CubicCurveTo(SVGPoint p1, SVGPoint p2, SVGPoint p, float width)
    {
        SVGPoint _point = new SVGPoint(0f, 0f);
        _point.SetValue(this._basicDraw.currentPoint);

        SVGPoint _p1 = new SVGPoint(0f, 0f);
        SVGPoint _p2 = new SVGPoint(0f, 0f);
        SVGPoint _p3 = new SVGPoint(0f, 0f);
        SVGPoint _p4 = new SVGPoint(0f, 0f);

        bool temp;
        temp = this._graphics.GetThickLine(_point, p1, width, ref _p1, ref _p2, ref _p3, ref _p4);
        if(temp == false) {
          QuadraticCurveTo(p2, p, width);
          return;
        }

        SVGPoint _p5 = new SVGPoint(0f, 0f);
        SVGPoint _p6 = new SVGPoint(0f, 0f);
        SVGPoint _p7 = new SVGPoint(0f, 0f);
        SVGPoint _p8 = new SVGPoint(0f, 0f);

        this._graphics.GetThickLine(p1, p2, width, ref _p5, ref _p6, ref _p7, ref _p8);

        SVGPoint _p9 = new SVGPoint(0f, 0f);
        SVGPoint _p10 = new SVGPoint(0f, 0f);
        SVGPoint _p11 = new SVGPoint(0f, 0f);
        SVGPoint _p12 = new SVGPoint(0f, 0f);

        this._graphics.GetThickLine(p2, p, width, ref _p9, ref _p10, ref _p11, ref _p12);

        SVGPoint _cp1, _cp2, _cp3, _cp4;
        _cp1 = this._graphics.GetCrossPoint(_p1, _p3, _p5, _p7);
        _cp2 = this._graphics.GetCrossPoint(_p2, _p4, _p6, _p8);
        _cp3 = this._graphics.GetCrossPoint(_p5, _p7, _p9, _p11);
        _cp4 = this._graphics.GetCrossPoint(_p6, _p8, _p10, _p12);

        this._basicDraw.MoveTo(_point);
        this._basicDraw.CubicCurveTo(p1, p2, p);

        SVGGraphicsPath _graphicsPath = new SVGGraphicsPath();
        _graphicsPath.AddMoveTo(_p2);
        _graphicsPath.AddCubicCurveTo(_cp2, _cp4, _p12);
        _graphicsPath.AddLineTo(_p11);
        _graphicsPath.AddCubicCurveTo(_cp3, _cp1, _p1);
        _graphicsPath.AddLineTo(_p2);
        this._graphics.FillPath(_graphicsPath);

        MoveTo(p);
    }
开发者ID:pjezek,项目名称:UnitySVG,代码行数:51,代码来源:SVGGraphicsStroke.cs


注:本文中的SVGGraphicsPath.AddCubicCurveTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。