コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: kujawskip/SPD
        private void Color_OnClick(object sender, RoutedEventArgs e)
        {
            var cp = new ColorPicker(_colorPickerIndex, 2 + GetNeighboursCount((Neighbourhoods)NeighbourBox.SelectedItem, (int)Slider1.Value));
            var b  = cp.ShowDialog();

            if (b.HasValue && b.Value)
            {
                _colorPickerIndex = cp.Id;
                _colorPicking     = cp.Box.SelectedItem as ColorPicking;
            }
        }
コード例 #2
0
        /// <summary>
        /// Metoda inicjalizująca generująca pędzle i OxyColory
        /// </summary>
        /// <param name="count">Ilość kolorów do wygenerowania</param>
        public static void CreateBrushes(int count = MAX)
        {
            _brushArray = new Brush[count];
            _oxyArray   = new OxyColor[count];
            var cp = ColorPicking.RegularPickingFactory(count);

            for (var p = 0; p < count; p++)
            {
                _brushArray[p] = cp.GenerateBrush(p);
                _oxyArray[p]   = cp.GenerateOxyColor(p);
            }
        }
コード例 #3
0
        public ColorPicker(int index, int stateCount)
        {
            InitializeComponent();
            _stateCount = stateCount;
            Box.Items.Add(ColorPicking.RegularPickingFactory(stateCount));
            Box.Items.Add(ColorPicking.ReverseRegularPickingFactory(stateCount));
            Box.Items.Add(ColorPicking.GrayScaleFactory(stateCount));
            Box.Items.Add(ColorPicking.RainbowFactory(stateCount));
            Box.Items.Add(ColorPicking.CitrusFactory(stateCount));
            Box.SelectedIndex = index;

            Id  = index;
            _id = index;
        }
コード例 #4
0
ファイル: MainWindow.xaml.cs プロジェクト: kujawskip/SPD
        public MainWindow()
        {
            SPDAssets.CreateBrushes();
            SPDAssets.ChangeFont("Arial");
            SPDAssets.InitialiseDescriptions();
            _colorPicking = ColorPicking.RegularPickingFactory(10);
            InitializeComponent();

            InitialConditions.Initialise();
            ShapeBox.ItemsSource = Enum.GetValues(typeof(Shape));
            NeighbourBox.ItemsSource = Enum.GetValues(typeof(Neighbourhoods));
            ShapeBox.SelectedItem = Shape.Płaski;
            NeighbourBox.SelectedItem = Neighbourhoods.Moore;

            DataContext = this;
            Error = ValidationErrors.None;
            _canvalidate = true;
        }
コード例 #5
0
ファイル: MainWindow.xaml.cs プロジェクト: kujawskip/SPD
        public MainWindow()
        {
            SPDAssets.CreateBrushes();
            SPDAssets.ChangeFont("Arial");
            SPDAssets.InitialiseDescriptions();
            _colorPicking = ColorPicking.RegularPickingFactory(10);
            InitializeComponent();

            InitialConditions.Initialise();
            ShapeBox.ItemsSource      = Enum.GetValues(typeof(Shape));
            NeighbourBox.ItemsSource  = Enum.GetValues(typeof(Neighbourhoods));
            ShapeBox.SelectedItem     = Shape.Płaski;
            NeighbourBox.SelectedItem = Neighbourhoods.Moore;

            DataContext  = this;
            Error        = ValidationErrors.None;
            _canvalidate = true;
        }
コード例 #6
0
ファイル: ColorPicker.xaml.cs プロジェクト: kujawskip/SPD
 public void ChangeColors(ColorPicking p)
 {
     p.ModifyColors();
 }
コード例 #7
0
 public void ChangeColors(ColorPicking p)
 {
     p.ModifyColors();
 }
コード例 #8
0
ファイル: MainWindow.xaml.cs プロジェクト: kujawskip/SPD
        private void Color_OnClick(object sender, RoutedEventArgs e)
        {
            var cp = new ColorPicker(_colorPickerIndex, 2+GetNeighboursCount((Neighbourhoods)NeighbourBox.SelectedItem, (int)Slider1.Value));
            var b = cp.ShowDialog();
            if (b.HasValue && b.Value)
            {
                _colorPickerIndex = cp.Id;
                _colorPicking = cp.Box.SelectedItem as ColorPicking;

            }
        }