public partial class Draw : Form
    {
        Graphics myGraphics;
        int x;
        int y;
        int oldX;
        int oldY;
        Pen myPen;
        bool ifDrwa;
        Stack<Point> pointStack;//用来保存所有鼠标画过的点,在重绘时候画
        public Draw()
        {
           ifDrwa = false;//设置为不画
           myGraphics = this.CreateGraphics();
           
           myPen=new Pen(Color.Black);
           InitializeComponent();
           this.SetDesktopLocation(0, 0);
           pointStack = new Stack<Point>();
        //   this.Size.Width = 768;
        //   this.Size.Height = 1024;
        }        private void Draw_MouseDown(object sender, MouseEventArgs e)
        {
            ifDrwa = true;//鼠标按下时候才开始画
            oldX = e.X;
            oldY = e.Y;
        }        private void Draw_MouseMove(object sender, MouseEventArgs e)
        {
           
            if (ifDrwa == true)
            { 
                //将鼠标划过的地方全部入栈
             Point tempPoint = new Point(this.oldX, this.oldY);
             pointStack.Push(tempPoint);//鼠标不停的滑动,就不停的入栈
             myGraphics.DrawLine(myPen, oldX, oldY, e.X, e.Y);
             //画完后,将当前的鼠标位置记下
             oldX = e.X;
             oldY = e.Y;
            }
        }        private void Draw_MouseUp(object sender, MouseEventArgs e)
        {
            //若鼠标建起,则停止画
            ifDrwa = false;
        }
        画线可以实现,但是重绘时候就没了,希望知道怎么保存先前画的线