public ScribbleForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            dibujo = new Dibujo();
            trazo = null;
            color = Color.Black;
            width = 1;
        }
        public ScribbleForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            dibujo = new Dibujo();
            trazo = null;
            color = Color.Black;
            width = 1;
        }
Example #3
0
 public void Add(Trazo trazo)
 {
     trazos.Add(trazo);
 }
 private void ScribbleForm_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (trazo != null)
         {
             trazo.Add(new Point(e.X, e.Y));
             trazo.Draw(this.CreateGraphics());
             dibujo.Add(trazo);
             trazo = null;
         }
     }
     else
     {
         dibujo.Clear();
         this.Invalidate();
         this.Update();
     }
 }
 private void ScribbleForm_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         trazo = new Trazo(color, width);
         trazo.Add(new Point(e.X, e.Y));
     }
 }
 public void Add(Trazo trazo)
 {
     trazos.Add(trazo);
 }