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


C# XGraphics.DrawClosedCurve方法代码示例

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


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

示例1: RenderClosedCurves

    void RenderClosedCurves(XGraphics gfx)
    {
      gfx.TranslateTransform(15, 20);

      XPen pen = new XPen(XColors.DarkBlue, 2.5);
      gfx.DrawClosedCurve(pen, XBrushes.SkyBlue,
        new XPoint[] { new XPoint(10, 120), new XPoint(80, 30), new XPoint(220, 20), new XPoint(170, 110), new XPoint(100, 90) },
        XFillMode.Winding, 0.7);
    }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:9,代码来源:ClosedCurves.cs

示例2: RenderPage

    /// <summary>
    /// Demonstrates the use of XGraphics.DrawClosedCurve.
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      base.RenderPage(gfx);

      XPoint[] points = new XPoint[]
      {
        new XPoint(50, 100),
        new XPoint(450, 120),
        new XPoint(550, 300),
        //new XPoint(150, 380),
      };

      gfx.DrawClosedCurve(properties.Pen2.Pen, properties.Brush1.Brush, points, 
        properties.General.FillMode, properties.General.Tension);
    }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:18,代码来源:ShapesClosedCurve.cs

示例3: RenderPage

    /// <summary>
    /// Source and more infos: http://www.math.dartmouth.edu/~dlittle/java/SpiroGraph/
    /// </summary>
    public override void RenderPage(XGraphics gfx)
    {
      base.RenderPage(gfx);

      //int R =  60, r =  60, p =   60, N = 270; // Cardioid
      //int R =  60, r = -45, p = -101, N = 270; // Rounded Square
      //int R =  75, r = -25, p =   85, N = 270; // Gold fish
      //int R =  75, r = -30, p =   60, N = 270; // Star fish
      //int R = 100, r =  49, p =   66, N =   7; // String of Pearls
      //int R =  90, r =   1, p =  105, N = 105; // Rotating Triangle

      //int R =  90, r =   1, p =  105, N = 105;
      int R =  60, r =   2, p =  122, N = 490;

      int revs = Math.Abs(r) / Gcd(R, Math.Abs(r));
      XPoint[] points = new XPoint[revs * N + 1];
      for (int i = 0; i <= revs * N; i++)
      {
        double t = 4 * i * Math.PI / N;
        points[i].X = ((R+r)*Math.Cos(t) - p * Math.Cos((R+r)* t / r));
        points[i].Y = ((R+r)*Math.Sin(t) - p * Math.Sin((R+r)* t / r));
      }

#if true
      // Draw as lines
      gfx.TranslateTransform(300, 250);
      gfx.DrawLines(properties.Pen2.Pen, points);

      //gfx.DrawPolygon(properties.Pen2.Pen, properties.Brush2.Brush, points, properties.General.FillMode);

      // Draw as closed curve
      gfx.TranslateTransform(0, 400);
      gfx.DrawClosedCurve(properties.Pen2.Pen, properties.Brush2.Brush, points, properties.General.FillMode,
        properties.General.Tension);
#else
      gfx.TranslateTransform(300, 400);
      XSolidBrush dotBrush = new XSolidBrush(properties.Pen2.Pen.Color);
      float width = properties.Pen2.Width;
      for (int i = 0; i < revs * N; i++)
        gfx.DrawEllipse(dotBrush,points[i].X, points[i].Y, width, width);
#endif
    }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:45,代码来源:MiscSpiroGraph.cs

示例4: DrawClosedCurve

    /// <summary>
    /// Draws a closed cardinal spline.
    /// </summary>
    void DrawClosedCurve(XGraphics gfx, int number)
    {
      BeginBox(gfx, number, "DrawClosedCurve");

      XPen pen = new XPen(XColors.DarkBlue, 2.5);
      gfx.DrawClosedCurve(pen, XBrushes.SkyBlue,
        new XPoint[] { new XPoint(10, 120), new XPoint(80, 30), new XPoint(220, 20), new XPoint(170, 110), new XPoint(100, 90) },
        XFillMode.Winding, 0.7);

      EndBox(gfx);
    }
开发者ID:vronikp,项目名称:EventRegistration,代码行数:14,代码来源:Shapes.cs


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