예제 #1
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            int imgSize, numSeeds;

            if (int.TryParse(tbImgSize.Text, out imgSize) && int.TryParse(tbSeedCount.Text, out numSeeds))
            {
                Diagram = new VoronoiDiagram(imgSize, numSeeds, 1);
                pbVoronoiDiagram.Image = Diagram.CreateImage();
            }
            else
            {
                tbSeedCount.Text = "";
                tbImgSize.Text   = "";
            }
        }
예제 #2
0
 private void btnGrow_Click(object sender, EventArgs e)
 {
     Diagram.GrowSeeds();
     pbVoronoiDiagram.Image = Diagram.CreateImage();
 }