Exemplo n.º 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedItem != null)
     {
         CEmblem emblem = (CEmblem)comboBox1.SelectedItem;
         emblem.Show();
         emblem.Draw(pictureBox2, emblem.angle);
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            count++;
            int     rand   = r.Next(5, 434);
            int     rand2  = r.Next(5, 434);
            int     rand3  = r.Next(5, 234);
            CEmblem emblem = new CEmblem(rand, rand2, rand3, "Emblem" + count, Color.Black);

            emblem.Show();
            emblem.Draw(pictureBox2, emblem.angle);
            comboBox1.Items.Add(emblem);
            comboBox1.SelectedItem = emblem;
        }
Exemplo n.º 3
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            int a = 0;

            if (checkBox1.Checked == true)
            {
                if (comboBox1.SelectedItem != null)
                {
                    CEmblem emblem = (CEmblem)comboBox1.SelectedItem;
                    emblem.animate = true;

                    while (true)
                    {
                        emblem.Hide();
                        emblem.Draw(pictureBox2, emblem.angle);
                        emblem.angle += 5;
                        emblem.Show();
                        emblem.Draw(pictureBox2, emblem.angle);


                        if (emblem.angle == 180)
                        {
                            emblem.animate = false;
                            emblem.Hide();
                            emblem.Draw(pictureBox2, emblem.angle);
                            emblem.angle = 0;
                            emblem.Show();
                            emblem.Draw(pictureBox2, emblem.angle);

                            break;
                        }
                        Thread.Sleep(50);
                    }
                }
            }
        }
Exemplo n.º 4
0
 private void button8_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedItem != null)
     {
         CEmblem emblem = (CEmblem)comboBox1.SelectedItem;
         if (emblem.currentColor == Color.White)
         {
             return;
         }
         emblem.Hide();
         emblem.Draw(pictureBox2, emblem.angle);
         emblem.MoveRight();
         emblem.Show();
         emblem.Draw(pictureBox2, emblem.angle);
     }
 }
Exemplo n.º 5
0
 private void button12_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedItem != null)
     {
         CEmblem emblem = (CEmblem)comboBox1.SelectedItem;
         if (emblem.currentColor == Color.White)
         {
             return;
         }
         emblem.Hide();
         emblem.Draw(pictureBox2, emblem.angle);
         emblem.SetLocation(pictureBox2.Width - emblem.GetSize(), emblem.GetY());
         emblem.Show();
         emblem.Draw(pictureBox2, emblem.angle);
     }
 }
Exemplo n.º 6
0
 private void button4_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedItem != null)
     {
         CEmblem emblem = (CEmblem)comboBox1.SelectedItem;
         if (emblem.CheckIfZero())
         {
             button5.Enabled = false;
         }
         else
         {
             button5.Enabled = true;
         }
         if (emblem.currentColor == Color.White)
         {
             return;
         }
         emblem.Hide();
         emblem.Draw(pictureBox2, emblem.angle);
         emblem.IncreaseSize();
         emblem.Show();
         emblem.Draw(pictureBox2, emblem.angle);
     }
 }