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; } }
/// <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); } }
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; }
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; }
public void ChangeColors(ColorPicking p) { p.ModifyColors(); }
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; } }