Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
        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;
        }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 public void ChangeColors(ColorPicking p)
 {
     p.ModifyColors();
 }
Exemplo n.º 7
0
 public void ChangeColors(ColorPicking p)
 {
     p.ModifyColors();
 }
Exemplo n.º 8
0
        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;

            }
        }