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; } }
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(); } }
public ClsTriangle(ClsDiem A, ClsDiem B) { begin = A; end = B; }
public ClsLine(ClsDiem A, ClsDiem B) { begin = A; end = B; }
public ClsLine() { begin = new ClsDiem(0, 0); end = new ClsDiem(0, 0); }