コード例 #1
0
        private void BtnSolveClick(object sender, RoutedEventArgs e)
        {
            List<Solver.Colorizer> colors = GenerateColorPalette();
            var slvr = new Solver(_charges, _surfaces, _imageHieght, _imageWidth);

            slvr.SolveIt();

            SolverOutput solvedutput;
            if (chkBoxDrawLines.IsChecked != null && chkBoxDrawLines.IsChecked == true)
            {
                BitmapSource outputData = slvr.CustomeColorizerSolverWithLines(colors,
                                                                               colorPickerLineColors.SelectedColor);

                solvedutput = new SolverOutput(outputData, colors, _charges);
            }
            else
            {
                BitmapSource outputData = slvr.CustomeColorizerSolver(colors);

                solvedutput = new SolverOutput(outputData, colors, _charges);
            }

            solvedutput.lblMarker.Visibility = Visibility.Hidden;
            solvedutput.recMarker.Visibility = Visibility.Hidden;
            solvedutput.gridMarker.Visibility = Visibility.Hidden;

            solvedutput.Show();
            Close();
        }
コード例 #2
0
        private void BtnSolveClick(object sender, RoutedEventArgs e)
        {
            List <Solver.Colorizer> colors = GenerateColorPalette();
            var slvr = new Solver(_charges, _surfaces, _imageHieght, _imageWidth);

            slvr.SolveIt();

            SolverOutput solvedutput;

            if (chkBoxDrawLines.IsChecked != null && chkBoxDrawLines.IsChecked == true)
            {
                BitmapSource outputData = slvr.CustomeColorizerSolverWithLines(colors,
                                                                               colorPickerLineColors.SelectedColor);

                solvedutput = new SolverOutput(outputData, colors, _charges);
            }
            else
            {
                BitmapSource outputData = slvr.CustomeColorizerSolver(colors);

                solvedutput = new SolverOutput(outputData, colors, _charges);
            }

            solvedutput.lblMarker.Visibility  = Visibility.Hidden;
            solvedutput.recMarker.Visibility  = Visibility.Hidden;
            solvedutput.gridMarker.Visibility = Visibility.Hidden;


            solvedutput.Show();
            Close();
        }