Exemple #1
0
 private void btnAddHand2_Click(object sender, EventArgs e)
 {
     try
     {
         myCard = new Card((RANK)cbRank.SelectedItem, (SUIT)cbSuit.SelectedItem, true);
         if (myCard.getRank() == 1)
             return;
         myHand2.Add(myCard);
         Bitmap bitmap = new Bitmap(myCard.getImage());
         Graphics g = Graphics.FromImage(b1);
         g.DrawImage(bitmap, 5 + j * 75, 5, 71, 96);
         j++;
         pictureBox2.Image = b1;
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }
Exemple #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         //Deck deck = new Deck(true);
         //deck.Shuffle();
         //Card dealCard = deck.Deal();
         //Bitmap bitmap = new Bitmap(dealCard.getImage());
         //pictureBox1.Image = bitmap;
         ////MessageBox.Show(dealCard.ToString());
         myCard = new Card((RANK)cbRank.SelectedItem, (SUIT)cbSuit.SelectedItem,true);
         if (myCard.getRank() == 1)
             return;
         myHand1.Add(myCard);
         Bitmap bitmap = new Bitmap(myCard.getImage());
         Graphics g = Graphics.FromImage(b2);
         g.DrawImage(bitmap, 5+i*75, 5, 71, 96);
         i++;
         pictureBox1.Image = b2;
     }
     catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }