private void DrawSegmentation(Rectangle rect) { pointCounter = (pointCounter + 1) % 15; if (pointCounter != 0) { return; } Point pt = new Point(rect.Left + rect.Width / 2, rect.Top + rect.Height / 2); if (segPoints.Count > 0) { segmentationImage.DrawLine(segPoints[segPoints.Count - 1], pt, Color.White); } segPoints.Add(pt); Rectangle rc = new Rectangle(pt, new Size(2, 2)); segmentationImage.DrawRectangle(rc, Color.Yellow); }