예제 #1
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            seeder      = new Random();
            pb.AutoSize = true;
            bitmap      = new Bitmap(512, 512);

            background = new Bitmap(512, 512);
            Graphics g2 = Graphics.FromImage(background);

            g2.Clear(Color.White);
            g2 = null;

            g = Graphics.FromImage(bitmap);
            g.SmoothingMode = SmoothingMode.HighQuality;
            g.Clear(Color.White);
            pb.Image      = bitmap;
            this.AutoSize = true;

            voroObject = new Voronoi(0.1);
        }
예제 #2
0
 public EdgeList(Voronoi voronoi, int hashSize)
 {
     Voronoi                              = voronoi;
     _edgeListHashSize                    = 2 * hashSize;
     _edgeListHash                        = new HalfEdge[_edgeListHashSize];
     _edgeListLeftHalfEdge                = new HalfEdge();
     _edgeListRightHalfEdge               = new HalfEdge();
     _edgeListLeftHalfEdge.Left           = null;
     _edgeListLeftHalfEdge.Right          = _edgeListRightHalfEdge;
     _edgeListRightHalfEdge.Left          = _edgeListLeftHalfEdge;
     _edgeListRightHalfEdge.Right         = null;
     _edgeListHash[0]                     = _edgeListLeftHalfEdge;
     _edgeListHash[_edgeListHashSize - 1] = _edgeListRightHalfEdge;
 }
예제 #3
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            seeder = new Random();
            pb.AutoSize = true;
            bitmap = new Bitmap (512,512);

            background = new Bitmap ( 512, 512 );
            Graphics g2 = Graphics.FromImage ( background );
            g2.Clear (Color.White);
            g2 = null;

            g = Graphics.FromImage (bitmap);
            g.SmoothingMode = SmoothingMode.HighQuality;
            g.Clear (Color.White);
            pb.Image = bitmap;
            this.AutoSize = true;

            voroObject = new Voronoi ( 0.1 );
        }