/// <summary>Initialize form components for the Color Quantization Viewer Instance /// </summary> public void Initialize() { this.toolStripMenuItemLoadImage.Click += toolStripMenuItemLoadImage_Click; this.buttonPerformQuantization.Click += buttonUpdateImage_Click; this.numericUpDownColorCount.KeyDown += numericUpDownColorCount_KeyDown; this.comboBoxImageDisplayed.SelectedIndexChanged += comboBoxImageDisplayed_SelectedIndexChanged; this.pictureBoxDisplay.MouseClick += pictureBoxDisplay_MouseClick; this.toolStripMenuItemSaveImage.Click += toolStripMenuItemSaveImage_Click; this.buttonCustomPalette.Click += buttonCustomPalette_Click; this.checkBoxUseCustomColorPalette.Click += checkBoxUseCustomColorPalette_Click; this.numericUpDownColorCount.ValueChanged += numericUpDownColorCount_ValueChanged; this.panelImage.Layout += panelImage_Layout; this.chartColors.Click += chartColors_Click; this.pictureBoxDisplay.BackColor = Color.LightGray; this.pictureBoxDisplay.SizeMode = PictureBoxSizeMode.Zoom; displayedAxis = DisplayedAxes.RG; BindComboBox(); }
/// <summary>Change the colors shown on the color chart /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void chartColors_Click( object sender, EventArgs e ) { int displayed = (((int) displayedAxis) + 1) % 3; switch ( displayed ) { case 0: displayedAxis = DisplayedAxes.RG; break; case 1: displayedAxis = DisplayedAxes.RB; break; default: displayedAxis = DisplayedAxes.GB; break; } //Show the wait cursor while the Color chart is being bound Cursor.Current = Cursors.WaitCursor; BindColorChart(); Cursor.Current = Cursors.Default; }