private void preview_Paint(object sender, PaintEventArgs e)
{
List<PointF> points = GetRandomPoints();
RectangleF size = new RectangleF(0, 0, preview.Width, preview.Height);
Voronoi voronoi = new Voronoi(points, null, size);
foreach (PointF point in points)
{
List<PointF> region = voronoi.Region(point);
e.Graphics.DrawRectangle(Pens.Red, point.X, point.Y, 10, 10);
e.Graphics.DrawLines(Pens.Black, region.ToArray());
}
}