Beispiel #1
0
        private void trackBar_ValueChanged(object sender, EventArgs e)
        {
            TrackBar here = (TrackBar)sender;

            if (chUse == 1)
            {// only one channel mode
                if (here.Tag.Equals("CH1"))
                {
                    trackBar2.Value = 0;
                    trackBar3.Value = 0;
                    outView         = MyDeal.threshold(imgView, here.Value, colorMode.GRAY);
                }
            }
            else
            {
                int[] thresholds = new int[3];
                thresholds[2] = trackBar1.Value; //R
                thresholds[1] = trackBar2.Value; //G
                thresholds[0] = trackBar3.Value; //B
                outView       = MyDeal.threshold(imgView, thresholds);
            }
            if (here.Tag.Equals("CH1"))
            {
                textBox1.Text = here.Value.ToString();
            }
            else if (here.Tag.Equals("CH2"))
            {
                textBox2.Text = here.Value.ToString();
            }
            else if (here.Tag.Equals("CH3"))
            {
                textBox3.Text = here.Value.ToString();
            }
        }
Beispiel #2
0
 protected override void pictureBox1_Paint(object sender, PaintEventArgs e)
 {
     int[] thresholds = new int[3];
     thresholds[2] = trackBar1.Value; //R
     thresholds[1] = trackBar2.Value; //G
     thresholds[0] = trackBar3.Value; //B
     outView       = MyDeal.threshold(imgView, thresholds);
 }