Exemple #1
0
 private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
 {
     if (pointer == false)
     {
         canDraw = true;
         begin   = new ClsDiem(e.X, e.Y);
         rect.X  = e.X;
         rect.Y  = e.Y;
     }
 }
Exemple #2
0
        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (canDraw == true)
            {
                end = new ClsDiem(e.X, e.Y);
                g.Clear(pictureBox1.BackColor);
                if (pointer)
                {
                    return;
                }
                else if (isLine == true)
                {
                    g.DrawLine(pen, begin.x, begin.y, e.X, e.Y);
                }
                else if (isTriangle == true)
                {
                    rect.Size = new Size(end.x - begin.x, end.y - begin.y);
                    g.DrawEllipse(pen, rect);
                }

                Update();
            }
        }
Exemple #3
0
 public ClsTriangle(ClsDiem A, ClsDiem B)
 {
     begin = A;
     end   = B;
 }
Exemple #4
0
 public ClsLine(ClsDiem A, ClsDiem B)
 {
     begin = A;
     end   = B;
 }
Exemple #5
0
 public ClsLine()
 {
     begin = new ClsDiem(0, 0);
     end   = new ClsDiem(0, 0);
 }