Esempio n. 1
0
 private void SetupMine()
 {
     for (i = 0; i < 100; i++)
     {
         mylines[i] = new MyLines();
     }
     for (i = 0; i < 100; i++)
     {
         myrect[i] = new MyRect();
     }
     for (i = 0; i < 100; i++)
     {
         mycircle[i] = new MyCircle();
     }
 }
Esempio n. 2
0
        private void child_panel_MouseMove(object sender, MouseEventArgs e)
        {
            if ((start.X == 0) && (start.Y == 0))
            {
                return;
            }

            finish.X = e.X;
            finish.Y = e.Y;
            Point curPoint = new Point(e.X, e.Y);

            if (line == true)
            {
                mylines[nline].setPoint(start, finish, thick, fill, color);
            }

            if (rect == true)
            {
                myrect[nrect].setRect(start, finish, thick, fill, color);
            }

            if (circle == true)
            {
                mycircle[ncircle].setRectC(start, finish, thick, fill, color);
            }

            if ((bru == true || pencil == true) && e.Button == MouseButtons.Left)
            {
                Pen pencile = new Pen(color);
                if (pencil)
                {
                    pencile.Width = 1;
                }
                else
                {
                    pencile.Width = 5;
                }
                MyLines my = new MyLines();
                my.setPoint(start, curPoint, pencile.Width, false, color);
                start = curPoint;
                mypen.Add(my);
            }

            doubleBufferPanel1.Invalidate(true);
            doubleBufferPanel1.Update();
        }