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); } }
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); } }
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); } }
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); } }
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); } }
private void nbBuyIn_ValueChanged(object sender, EventArgs e) { _settings.BuyIn = nbBuyIn.Value; AppSettingsManager.Save(_settings); }
private void cbRemoveDollarSign_CheckedChanged(object sender, EventArgs e) { _settings.RemoveDollar = cbRemoveDollarSign.Checked; AppSettingsManager.Save(_settings); }
private void tbPreFlopWaitRoundLimit_ValueChanged(object sender, EventArgs e) { _settings.PreFlopWaitRoundLimit = tbPreFlopWaitRoundLimit.Value; AppSettingsManager.Save(_settings); }
private void tbMinBet_ValueChanged(object sender, EventArgs e) { _settings.MinBet = tbMinBet.Value; AppSettingsManager.Save(_settings); }
private void tbShortStackPercent_ValueChanged(object sender, EventArgs e) { _settings.ShortStackPercent = tbShortStackPercent.Value; AppSettingsManager.Save(_settings); }
private void tbBluff_ValueChanged(object sender, EventArgs e) { _settings.BluffPercent = tbBluff.Value; AppSettingsManager.Save(_settings); }
private void tbMinCardSize_ValueChanged(object sender, EventArgs e) { _settings.MinCardSize = tbMinCardSize.Value; AppSettingsManager.Save(_settings); }
private void tbRebuyLevel_ValueChanged(object sender, EventArgs e) { _settings.RebuyLevel = tbRebuyLevel.Value; AppSettingsManager.Save(_settings); }
private void tbTotalLimit_ValueChanged(object sender, EventArgs e) { _settings.Limit = tbTotalLimit.Value; AppSettingsManager.Save(_settings); }
private void btSave_Click(object sender, EventArgs e) { AppSettingsManager.Save(_settings); }