コード例 #1
0
ファイル: ColorPanel.xaml.cs プロジェクト: thomasvt/glyphedit
        private void UpdateColorPaletteFromGrid()
        {
            if (_currentColorPalette == null)
            {
                throw new Exception("No ColorPalette selected.");
            }

            var newColors = new GlyphColor[ColorGrid.ColumnCount, ColorGrid.RowCount];

            // fill with patches in Grid
            foreach (var colorPatch in ColorGrid.ColorPatches)
            {
                newColors[colorPatch.GridLocation.X, colorPatch.GridLocation.Y] = colorPatch.Color.ToGlyphColor();
            }

            _currentColorPalette.ChangeColors(newColors);
        }