示例#1
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);
            }
        }
示例#2
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;
        }
示例#3
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;
        }