Пример #1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     DoubleBuffered = true;
     Canvas.Top     = 0;
     Canvas.Left    = 0;
     Canvas.Width   = Width - 16;
     Canvas.Height  = Height - 38;
     EF             = new EarthField(Logger.getNewLogger("test.txt"), "Main field", new Point[] { new Point(0, 0), new Point(Canvas.Width, 0), new Point(Canvas.Width, Canvas.Height), new Point(0, Canvas.Height) });
     Canvas.Image   = new Bitmap(Canvas.Width, Canvas.Height);
     Canvas.Image   = EF.paint(Canvas);
 }
Пример #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            // all animals are striving for goal and painting result
            Graphics gr = Graphics.FromImage(Canvas.Image);

            EF.tick();
            Canvas.Image = EF.paint(Canvas);
        }