zoukankan      html  css  js  c++  java
  • 2010 11 30 DrawCurve GDI绘制曲线

    vDrawCurve()方法

    该法用光滑的曲线把给定的点连接起来,常用形式有

    public void DrawCurve(Pen pen, Point[] points)

    其中,Point结构类型的数组中指明各节点,默认弯曲强度为0.5,注意数组中至少要有4个元素。

    public void DrawCurve(Pen pen, Point[] points, float tension)

    其中tension指定弯曲强度,该值范围为0.0f ~1.0f,超出此范围会产生异常,当弯曲强度为零时,就是直线

    演示:

    private void Form1_Paint(object sender,

                           System.Windows.Forms.PaintEventArgs e)

    {

      Pen redPen   = new Pen(Color.Red, 3);

      Pen greenPen = new Pen(Color.Green, 3);

      Point[] curvePoints =

      {

      new Point( 50,  250),

      new Point(100,  25),

      new Point(200,  250),

      new Point(250,  50),

      new Point(300,  75),

      new Point(350,  200),

      new Point(400,  150)

      };

      e.Graphics.DrawLines(redPen, curvePoints);

      e.Graphics.DrawCurve(greenPen, curvePoints);

    }

  • 相关阅读:
    【bzoj 1143】[CTSC2008]祭祀river
    【SRM-09 B】撕书II
    【刷题记录】BZOJ-USACO
    【noip 2014】提高组Day2T3.华容道
    【noip 2012】提高组Day2T3.疫情控制
    【noip 2012】提高组Day1T3.开车旅行
    点分治
    2—SAT问题
    生成树
    莫比乌斯反演
  • 原文地址:https://www.cnblogs.com/akak123/p/2269708.html
Copyright © 2011-2022 走看看