static void TestHandCards() { string bitmapsPath = String.Format("{0}", ConfigurationSettings.AppSettings["BitmapsFolderLocation"]); CardDetectionHandler.Initialize(bitmapsPath); Card[] hand = CardDetectionHandler.RetrieveYourHand(); Card[] comm = CardDetectionHandler.RetrieveCommunityCards(); Console.WriteLine("Cards in your hand : "); foreach (Card card in hand) { if (card != null) { Console.WriteLine(card.CardRank + " of " + card.CardSuit); } } Console.WriteLine("\nCards in Community : "); if (comm != null) { foreach (Card card in comm) { if (card != null) { Console.WriteLine(card.CardRank + " of " + card.CardSuit); } } } Console.ReadLine(); }
private void btnCommCards_Click(object sender, EventArgs e) { Card[] comm = CardDetectionHandler.RetrieveCommunityCards(); string msg = ""; if (comm != null) { foreach (Card card in comm) { if (card != null) { msg += card.CardRank + " of " + card.CardSuit + "\n"; } } } if (msg == "") { MessageBox.Show("No cards in Community.", "Cards in Community"); } else { MessageBox.Show(msg, "Cards in Community"); } }
private void btnCommunityCardCapture_Click(object sender, EventArgs e) { Bitmap PokerStarsWindow = CardDetectionHandler.CaptureCommunityCardsImage(); pictureBoxScreen.Width = PokerStarsWindow.Width; pictureBoxScreen.Height = PokerStarsWindow.Height; pictureBoxScreen.BackgroundImage = PokerStarsWindow; }
public Form1() { InitializeComponent(); string bitmapsPath = String.Format("{0}", ConfigurationSettings.AppSettings["BitmapsFolderLocation"]); CardDetectionHandler.Initialize(bitmapsPath); }
private void btnHandCards_Click(object sender, EventArgs e) { Card[] hand = CardDetectionHandler.RetrieveYourHand(); string msg = ""; foreach (Card card in hand) { if (card != null) { msg += card.CardRank + " of " + card.CardSuit + "\n"; } } if (msg == "") { MessageBox.Show("No cards in hand.", "Cards in Hand"); } else { MessageBox.Show(msg, "Cards in Hand"); } }