示例#1
0
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            flag = true;
            if (typeOfToDo)
            {
                vl = new VectorLine(e.Location, Color.Black, 2);
                canvas.figures.Add(vl);
            }
            else
            {
                pointToChange = e.Location;

                vl.MouseMoveTillCreate(e.Location);
                vectorImage = new Bitmap(pictureBox1.Width, pictureBox1.Height); //
                VectorGraph = Graphics.FromImage(vectorImage);                   //
                VectorGraph.Clear(Color.White);                                  //
                pictureBox1.Image = canvas.Update(vectorImage);
            }
        }
示例#2
0
文件: Form1.cs 项目: Dimonchan/Vector
 private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     flag = true;
     if (typeOfToDO)
     {
         vl = new VectorLine(e.Location, Color.Black, 1);
         canvas.figures.Add(vl);
     }
     else
     {
         vl = canvas.FindPoint(e.Location);
         if (vl != null)
         {
             for (int i = 0; i < vl.points.Count; i++)
             {
                 if (vl.points[i] == e.Location)
                 {
                     Tochka = i;
                 }
             }
         }
     }
 }