private void GraficadorForm_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 ScribbleForm() { // // Required for Windows Form Designer support // InitializeComponent(); dibujo = new Dibujo(); trazo = null; color = Color.Black; width = 1; }
public GraficadorForm() { // // 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; }
private void GraficadorForm_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(); } }
public void SendMessage(Trazo trazo) { Clients.All.MessageReceived(trazo); }