示例#1
0
        private void CmbPalette_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (_defPalette == null)
            {
                return; // too soon
            }
            var palName = cmbPalette.SelectedItem;

            if (palName.ToString() == BUILTIN)
            {
                _palette = _defPalette;
            }
            else
            {
                var palPath = Path.Combine(Application.StartupPath, "Palettes\\" + palName + ".map");
                var rgbvals = Palette2.LoadPalette(palPath);
                //List<Color> clrs = new List<Color>();
                //foreach (var anRGB in rgbvals)
                //{
                //    clrs.Add(anRGB.toColor());
                //}

                _palette = rgbvals;
            }
            MakeGradiant();
            Button1_Click(null, null);
        }
示例#2
0
        private void FillPalettes()
        {
            cmbPalette.BeginUpdate();
            cmbPalette.Items.Add(BUILTIN);
            var palFiles = Palette2.FindPalettes();

            foreach (var palFile in palFiles)
            {
                cmbPalette.Items.Add(Path.GetFileNameWithoutExtension(palFile));
            }

            cmbPalette.SelectedIndex = 0;
            cmbPalette.EndUpdate();
        }