Example #1
0
 private void btSelectDir_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         tbFile.Text            = openFileDialog1.FileName;
         _settings.TemplateFile = tbFile.Text;
         AppSettingsManager.Save(_settings);
     }
 }
Example #2
0
        private void tbTimer_TextChanged_1(object sender, EventArgs e)
        {
            int t;

            if (int.TryParse(tbTimer.Text, out t))
            {
                _settings.TimerInterval = t;
                AppSettingsManager.Save(_settings);
            }
        }
Example #3
0
        private void btnCardRank_Click(object sender, EventArgs e)
        {
            var  image  = Bitmap.FromFile(tbFile.Text) as Bitmap;
            Crop crop   = new Crop(_settings.MyCardsRect);//TODO card identity
            var  source = crop.Apply(image);

            FiltersSequence seq = new FiltersSequence();

            seq.Add(Grayscale.CommonAlgorithms.BT709); //First add  grayScaling filter
            seq.Add(new OtsuThreshold());              //Then add binarization(thresholding) filter
            var temp = seq.Apply(source);              // Apply filters on source image


            BlobCounter extractor = new BlobCounter();

            extractor.FilterBlobs = true;
            extractor.MinWidth    = extractor.MinHeight = (int)_settings.MinCardSize;//TODO card size
            //extractor.MaxWidth = extractor.MaxHeight = 70;//TODO card size
            extractor.ProcessImage(temp);

            //Will be used transform(extract) cards on source image
            //QuadrilateralTransformation quadTransformer = new QuadrilateralTransformation();


            Bitmap cardImg = null;

            foreach (Blob blob in extractor.GetObjectsInformation())
            {
                cardImg = source.Clone(blob.Rectangle, PixelFormat.DontCare);
                break;
            }

            var r = _settings.CardRankRect;
            var f = new AreaSelectorForm(new Rectangle(r.X * 5, r.Y * 5, r.Width * 5, r.Height * 5));

            f.Text = "Select CardRankRect rect";

            f.SetImage(cardImg, 5);
            if (f.ShowDialog() == DialogResult.OK)
            {
                var newRect = new Rectangle(
                    (int)Math.Round(f.Rect.X / 5.0),
                    (int)Math.Round(f.Rect.Y / 5.0),
                    (int)Math.Round(f.Rect.Width / 5.0),
                    (int)Math.Round(f.Rect.Height / 5.0));
                lblCardRank.Text       = newRect.ToString();
                _settings.CardRankRect = newRect;
                AppSettingsManager.Save(_settings);
            }
        }
Example #4
0
        private void btnFold5_Click(object sender, EventArgs e)
        {
            var f = new AreaSelectorForm(_settings.Fold5);

            f.Text = "Select Fold5 rect";
            var image = Bitmap.FromFile(tbFile.Text) as Bitmap;

            f.SetImage(image);
            if (f.ShowDialog() == DialogResult.OK)
            {
                lblFold5.Text   = f.Rect.ToString();
                _settings.Fold5 = f.Rect;
                AppSettingsManager.Save(_settings);
            }
        }
Example #5
0
        private void btnShort4_Click(object sender, EventArgs e)
        {
            var f = new AreaSelectorForm(_settings.ShortButtonRect4);

            f.Text = "Select Short button 4 rect";
            var image = Bitmap.FromFile(tbFile.Text) as Bitmap;

            f.SetImage(image);
            if (f.ShowDialog() == DialogResult.OK)
            {
                lblShort4.Text             = f.Rect.ToString();
                _settings.ShortButtonRect4 = f.Rect;
                AppSettingsManager.Save(_settings);
            }
        }
Example #6
0
        private void btnBetRaise_Click(object sender, EventArgs e)
        {
            var f = new AreaSelectorForm(_settings.BetRaiseRect);

            f.Text = "Select Check/Call button rect";
            var image = Bitmap.FromFile(tbFile.Text) as Bitmap;

            f.SetImage(image);
            if (f.ShowDialog() == DialogResult.OK)
            {
                lblBetRaise.Text       = f.Rect.ToString();
                _settings.BetRaiseRect = f.Rect;
                AppSettingsManager.Save(_settings);
            }
        }
Example #7
0
        private void _hook_KeyPressed(object sender, KeyPressedEventArgs e)
        {
            if (e.Modifier == miranda.ModifierKeys.Shift)
            {
                var         handle = WinApi.WindowFromPoint(Cursor.Position);
                WinApi.RECT rect;
                WinApi.GetWindowRect(handle, out rect);

                lblTableWindow.Text = "Handle " + handle.ToString() + "; WindowPoint = " + rect.Left + ", " + rect.Top;

                _settings.WindowPoint = new Point((int)rect.Left, (int)rect.Top);
                AppSettingsManager.Save(_settings);

                DrawRect(rect);
            }
        }
Example #8
0
 private void tbMinBet_ValueChanged(object sender, EventArgs e)
 {
     _settings.MinBet = tbMinBet.Value;
     AppSettingsManager.Save(_settings);
 }
Example #9
0
 private void tbTotalLimit_ValueChanged(object sender, EventArgs e)
 {
     _settings.Limit = tbTotalLimit.Value;
     AppSettingsManager.Save(_settings);
 }
Example #10
0
 private void nbBuyIn_ValueChanged(object sender, EventArgs e)
 {
     _settings.BuyIn = nbBuyIn.Value;
     AppSettingsManager.Save(_settings);
 }
Example #11
0
 private void cbRemoveDollarSign_CheckedChanged(object sender, EventArgs e)
 {
     _settings.RemoveDollar = cbRemoveDollarSign.Checked;
     AppSettingsManager.Save(_settings);
 }
Example #12
0
 private void tbPreFlopWaitRoundLimit_ValueChanged(object sender, EventArgs e)
 {
     _settings.PreFlopWaitRoundLimit = tbPreFlopWaitRoundLimit.Value;
     AppSettingsManager.Save(_settings);
 }
Example #13
0
 private void btSave_Click(object sender, EventArgs e)
 {
     AppSettingsManager.Save(_settings);
 }
Example #14
0
 private void tbShortStackPercent_ValueChanged(object sender, EventArgs e)
 {
     _settings.ShortStackPercent = tbShortStackPercent.Value;
     AppSettingsManager.Save(_settings);
 }
Example #15
0
 private void tbBluff_ValueChanged(object sender, EventArgs e)
 {
     _settings.BluffPercent = tbBluff.Value;
     AppSettingsManager.Save(_settings);
 }
Example #16
0
 private void tbMinCardSize_ValueChanged(object sender, EventArgs e)
 {
     _settings.MinCardSize = tbMinCardSize.Value;
     AppSettingsManager.Save(_settings);
 }
Example #17
0
 private void tbRebuyLevel_ValueChanged(object sender, EventArgs e)
 {
     _settings.RebuyLevel = tbRebuyLevel.Value;
     AppSettingsManager.Save(_settings);
 }