private void chk_8bpp_CheckedChanged(object sender, EventArgs e) { AbstractImage im = GetImageFromComboBoxItem(); if (im.CanSelectPalette()) { ((ISelectablePalette4bppImage)im).ImportExport8bpp = chk_8bpp.Checked; if (chk_8bpp.Checked) { im.CurrentPalette = Math.Max(0, im.CurrentPalette - 15); int upperIndexBound = Math.Max(1, im.PaletteCount - 15); ddl_Palette.Items.Clear(); for (int index = 0; index < upperIndexBound; index++) { ddl_Palette.Items.Add(index); } ddl_Palette.SelectedIndex = im.CurrentPalette; RefreshPictureBox(true); } else { SetupPaletteDropdown(); } } }
private void Setup8bppCheckbox(AbstractImage im = null) { if (im == null) { im = GetImageFromComboBoxItem(); } if (im.CanSelectPalette()) { chk_8bpp.Checked = ((ISelectablePalette4bppImage)im).ImportExport8bpp; chk_8bpp.Visible = true; } else { chk_8bpp.Visible = false; } }