using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace Ex02_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

         private void Form1_Click(object sender, EventArgs e)
        {
            Graphics graphics = this.CreateGraphics();         //创建Graphics对象
            Pen myPen = new Pen(Color.Red , 2);                //定义笔的颜色和宽度
            int beginX = 50;                                   //定义变量并赋值
            int beginY = 65;
            int height = 35;
            int width = 50;
            Point pointX1 = new Point(beginX, beginY);
            Point pointY1 = new Point(beginX + 210, beginY);
            Point pointX2 = new Point(beginX, beginY - 45);
            Point pointY2 = new Point(beginX, beginY + 45);
            graphics.DrawLine(myPen, pointX1, pointY1);             //调用DrawLine方法绘制水平和重直坐标轴
            graphics.DrawLine(myPen, pointX2, pointY2);
                                                                //绘制波形图
            graphics.DrawBezier(myPen, beginX, beginY, beginX + 15, beginY - height, beginX + 40, beginY - height, beginX + width, beginY);
            graphics.DrawBezier(myPen, beginX + width, beginY, beginX + width + 15, beginY + height,
                beginX + width + 40, beginY + height, beginX + width * 2, beginY);
            graphics.DrawBezier(myPen, beginX + width * 2, beginY, beginX + width * 2 + 15, beginY - height,
                beginX + width * 2 + 40, beginY - height, beginX + width * 3, beginY);
            graphics.DrawBezier(myPen, beginX + width * 3, beginY, beginX + width * 3 + 15, beginY + height,
                beginX + width * 3 + 40, beginY + height, beginX + width * 4, beginY);
        }

         private void Form1_Load(object sender, EventArgs e)
         {

         }

         private void Form1_DoubleClick(object sender, EventArgs e)
         {
             this.Close();
         }

       
    }
}
