Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            mashna = new Mashna();
            int   x      = ClientRectangle.Width / 2;
            int   y      = ClientRectangle.Height / 2;
            int   crvena = r.Next(256);
            int   zelena = r.Next(256);
            int   plava  = r.Next(256);
            Color boja   = Color.FromArgb(crvena, zelena, plava);

            mashna.Postavi(new Point(x, y), 150, 70, boja);
        }
Esempio n. 2
0
        private void Form2_Paint(object sender, PaintEventArgs e)
        {
            int a = 120;
            int b = 50;

            for (int x = a / 2; x < ClientRectangle.Width; x += a + 10)
            {
                for (int y = b / 2; y < ClientRectangle.Height; y += b)
                {
                    int    crvena = random.Next(256);
                    int    zelena = random.Next(256);
                    int    plava  = random.Next(256);
                    Color  boja   = Color.FromArgb(crvena, zelena, plava);
                    Mashna mashna = new Mashna();
                    mashna.Postavi(new Point(x, y), a, b, boja);
                    mashna.Crtaj(e.Graphics);
                }
            }
        }
Esempio n. 3
0
        private void Form3_Load(object sender, EventArgs e)
        {
            timer1.Start();
            timer1.Interval = 800;

            int x = r.Next(ClientRectangle.Width);
            int y = r.Next(ClientRectangle.Height);

            m1 = new Mashna();
            m1.Postavi(new Point(x, y));

            x  = r.Next(ClientRectangle.Width);
            y  = r.Next(ClientRectangle.Height);
            m2 = new Mashna();
            m2.Postavi(new Point(x, y));

            x  = r.Next(ClientRectangle.Width);
            y  = r.Next(ClientRectangle.Height);
            m3 = new Mashna();
            m3.Postavi(new Point(x, y));
        }