Exemple #1
0
 private void comboBoxPal_SelectedIndexChanged(object sender, EventArgs e)
 {
     Palette.SetPreset(comboBoxPal.SelectedIndex);
     PaintButtons();
 }
Exemple #2
0
        private void FormView_KeyDown(object sender, KeyEventArgs e)
        {
            //Листание картинок если их больше одной
            if (Files.Count() < 2)
            {
                return;
            }
            if (e.KeyCode == Keys.Left | e.KeyCode == Keys.PageUp)
            {
                index--;
                if (index < 0)
                {
                    index = Files.Count() - 1;
                }
                OpenPicture(Files[index]);
                return;
            }
            if (e.KeyCode == Keys.Right | e.KeyCode == Keys.PageDown)
            {
                index++;
                if (index > Files.Count() - 1)
                {
                    index = 0;
                }
                OpenPicture(Files[index]);
                return;
            }
            if (e.KeyCode == Keys.Home)
            {
                index = 0;
                OpenPicture(Files[index]);
                return;
            }
            if (e.KeyCode == Keys.End)
            {
                index = Files.Count() - 1;
                OpenPicture(Files[index]);
                return;
            }

            //Изменение пресета палитры
            if (e.KeyCode == Keys.D1)
            {
                Palette.GetPal(ref Col, 0);
                DrawPicture();
                return;
            }
            if (e.KeyCode == Keys.D2)
            {
                Palette.GetPal(ref Col, 1);
                DrawPicture();
                return;
            }
            if (e.KeyCode == Keys.D3)
            {
                Palette.GetPal(ref Col, 2);
                DrawPicture();
                return;
            }
            if (e.KeyCode == Keys.D4)
            {
                Palette.GetPal(ref Col, 3);
                DrawPicture();
                return;
            }
            Close();
        }