Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            var b = new Bitmap(pictureBox1.Width, pictureBox1.Height);

            g = Graphics.FromImage(b);
            pictureBox1.Image = b;
            pyramid           = new Pyramid(g, new Point(300, 300));
        }
Ejemplo n.º 2
0
 private void BorderCrossed(Pyramid p)
 {
     if (p.FlowRight && p.A.X >= pictureBox1.Width ||
         !p.FlowRight && p.B.X <= 0)
     {
         p.MoveX *= -1;
     }
     if (p.FlowDown && p.C.Y >= pictureBox1.Height ||
         !p.FlowDown && p.H.Y <= 0)
     {
         p.MoveY *= -1;
     }
 }