Exemplo n.º 1
0
        private void BtnProccess_OnClick(object sender, RoutedEventArgs e)
        {
            int limit = 1;
            IDetectingAlgorithm algrorithm = (IDetectingAlgorithm)SelectedAlgorithm.SelectedItem;

            if (Limit.Text != "" && Int32.TryParse(Limit.Text, out limit) && algrorithm != null && this._source != null)
            {
                Bitmap      bitmap     = BitmapConverter.BitmapImage2Bitmap(this._source);
                Bitmap      edges      = algrorithm.DetecteEdges(bitmap, limit);
                BitmapImage imageEdges = BitmapConverter.Bitmap2ImageSource(edges);
                FilteredImage.Source = imageEdges;
            }
            else
            {
                MessageBox.Show(
                    "Please input a limit for filtering. \nYou may not select file. \nYou have to select algorithm for filtering");
            }
        }