asmrobot
2019-10-29 f25f89101a98ad815c0ae2d25e1a8dc35d53a5dd
src/RichCreator.Editor/MainWindow.xaml.cs
@@ -353,7 +353,7 @@
            }
        }
        //Hsv查找选区
        private void FindSelectionForHsv(object sender, RoutedEventArgs e)
        {
            Int32 thresholdValue = (Int32)this.ThresholdSlider.Value;
@@ -373,6 +373,29 @@
            }
        }
        /// <summary>
        /// Thresold查找选取
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FindSelectionForThresold(object sender, RoutedEventArgs e)
        {
            Int32 thresholdValue = (Int32)this.ThresholdSlider.Value;
            string colorString = SerialToString();
            ColorArray colorArray = ColorArray.FromThresholdString(thresholdValue, colorString);
            ZTRectangle rect = ZTRectangle.Empty;
            ZTRectangle limit = new ZTRectangle(0, 0, this.targetImage.Width - 1, this.targetImage.Height - 1);
            bool result = CVHelper.FindColorArrayForThreshold(out rect, this.sourceImage, colorArray, limit);
            if (result)
            {
                DrawRectangle(rect.Start.X, rect.Start.Y, rect.End.X - rect.Start.X + 1, rect.End.Y - rect.Start.Y + 1, Colors.Green);
            }
            else
            {
                MessageBox.Show("未找到");
            }
        }
        /// <summary>
        /// 查找所有方块
@@ -1087,15 +1110,15 @@
            mt.ShowDialog();
        }
        private void AStarTools_Click(object sender, RoutedEventArgs e)
        {
            AStarTools window = new AStarTools();
            window.ShowDialog();
        }
        //private void AStarTools_Click(object sender, RoutedEventArgs e)
        //{
        //    AStarTools window = new AStarTools();
        //    window.ShowDialog();
        //}
        private void DijkstraTools_Click(object sender, RoutedEventArgs e)
        {
            DijkstraTools window = new DijkstraTools();
            MapEditor window = new MapEditor();
            window.ShowDialog();
        }