private void colors_listView_SelectedIndexChanged(object sender, EventArgs e) { if (Layers.CurrentLayer != null) { if (colors_listView.SelectedItems.Count != 0) { Layers.CurrentLayer.Foreground = new Picture(Layers.CurrentLayer.Foreground.OriginalImage); effects = new Effects(); switch (colors_listView.SelectedIndices[0]) { case 0: selectedColor = ColorChannelType.RGB; break; case 1: selectedColor = ColorChannelType.R; break; case 2: selectedColor = ColorChannelType.G; break; case 3: selectedColor = ColorChannelType.B; break; } effects.ChangeColorChannel(selectedColor); effects = new Effects(); pictureBox.Image = Layers.CurrentLayer.Foreground.EditImage; } } }
private void RefreshColorChanelsView() { if (layers != null) { ColorChannelChange(); colors_imageList.Images.Clear(); for (int i = 0; i < 4; i++) { Layers.CurrentLayer.Foreground = new Picture(Layers.CurrentLayer.Foreground.OriginalImage); effects = new Effects(); effects.ChangeColorChannel((ColorChannelType)i); colors_imageList.Images.Add(Layers.CurrentLayer.Foreground.EditImage); } for (int i = 3; i >= 0; i--) { colors_listView.Items[i].ImageIndex = Math.Abs(i - 3); } Layers.CurrentLayer.Foreground = new Picture(Layers.CurrentLayer.Foreground.OriginalImage); effects = new Effects(); colors_listView.Refresh(); pictureBox.Image = Layers.CurrentLayer.Foreground.EditImage; } }