예제 #1
0
 private void trackBar2_Scroll(object sender, EventArgs e)
 {
     bf = image[tabControl1.SelectedIndex].Gamma(dif);
     his = new Histogramdrawing();
     his.drawing(bf, chart1);
     picbox = (PictureBox)tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0];
     picbox.Image = image[tabControl1.SelectedIndex].Gamma(dif).source;
 }
예제 #2
0
 private void quanToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Form2 fm2 = new Form2();
     fm2.label1.Text = "Quantization";
     fm2.ShowDialog();
     if (!string.IsNullOrEmpty(fm2.textBox1.Text))
     {
         int value = Convert.ToInt32(fm2.textBox1.Text);
         image[tabControl1.SelectedIndex].Quantization(value);
         picbox = (PictureBox)tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0];
         picbox.Image = image[tabControl1.SelectedIndex].ImageLockBitmap.source;
         his = new Histogramdrawing();
         his.drawing(image[tabControl1.SelectedIndex].ImageLockBitmap, this.chart1);
     }
 }
예제 #3
0
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     his = new Histogramdrawing();
     his.drawing(image[tabControl1.SelectedIndex].ImageLockBitmap, this.chart1);
 }
예제 #4
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            image[counter] = new ImageController();

            if (ofd.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(ofd.FileName))
            {
                chart1.Show();
                Benchmark.Start();
                image[counter].Read(ofd.FileName);
                Benchmark.End();
                image[counter].ImageLockBitmap.UnlockBits();
                Benchmark.End();
                this.textBox1.Text = Benchmark.GetSeconds().ToString();
                tabpag[counter] = new TabPage();
                PictureBox p = new PictureBox();
                p.Size = new Size(350, 350);
                p.SizeMode = PictureBoxSizeMode.Zoom;

                p.Image = (image[counter].ImageLockBitmap.source);
                tabpag[counter].Controls.Add(p);
                tabpag[counter].Text = image[counter].PP36File.namefile;
                tabControl1.TabPages.Add(tabpag[counter]);
                his = new Histogramdrawing();
                his.drawing(image[counter].ImageLockBitmap, chart1);
                tabControl1.SelectedIndex = counter;
                counter++;
            }
        }
예제 #5
0
 private void numericUpDown2_ValueChanged(object sender, EventArgs e)
 {
     picbox = (PictureBox)tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0];
     bf = image[tabControl1.SelectedIndex].Gamma(dif);
     his = new Histogramdrawing();
     his.drawing(bf, chart1);
     picbox = (PictureBox)tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0];
     picbox.Image = bf.source;
 }
예제 #6
0
        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            numericUpDown1.Value = trackBar1.Value;
            pictureBox1.Image = im.Brightness(trackBar1.Value);
            Histogramdrawing his = new Histogramdrawing();
            his.drawing(new Bitmap(pictureBox1.Image));

            for (int w = 0; w < 256; w++)
            {
                chart1.Series["Red"].Points.AddXY(w, his.Rarray[w]);

                chart1.Series["Green"].Points.AddXY(w, his.Garray[w]);
                chart1.Series["Blue"].Points.AddXY(w, his.Garray[w]);

            }
            chart1.Series["Green"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Green"].Color = Color.Green;
            chart1.Series["Red"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Red"].Color = Color.Red;
            chart1.Series["Blue"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Blue"].Color = Color.Blue;
        }
예제 #7
0
        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            trackBar1.Value = decimal.ToInt32(numericUpDown1.Value);
            pictureBox1.Image = im.Brightness(trackBar1.Value);
            Histogramdrawing his = new Histogramdrawing();
            his.drawing(im.ImageBitmap);

            for (int w = 0; w < 256; w++)
            {
                chart1.Series["Red"].Points.AddXY(w, his.Rarray[w]);
                chart1.Series["Green"].Points.AddXY(w, his.Garray[w]);
                chart1.Series["Blue"].Points.AddXY(w, his.Garray[w]);

            }
            chart1.Series["Green"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Green"].Color = Color.Green;
            chart1.Series["Red"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Red"].Color = Color.Red;
            chart1.Series["Blue"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Blue"].Color = Color.Blue;
        }
예제 #8
0
        private void image1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            trackBar1.Value = 0;
            trackBar2.Value = 0;
            trackBar3.Value = 0;
            numericUpDown1.Value = 0;
            numericUpDown2.Value = 0;
            numericUpDown3.Value = 0;

            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(ofd.FileName))
            {
                pictureBox1.Image = im.Read(ofd.FileName);
                pictureBox1.Size = im.ImageBitmap.Size;
            }
            Histogramdrawing his = new Histogramdrawing();
            his.drawing(im.ImageBitmap);
            for (int w = 0; w < 256; w++)
            {
                chart1.Series["Red"].Points.AddXY(w, his.Rarray[w]);
                chart1.Series["Green"].Points.AddXY(w, his.Garray[w]);
                chart1.Series["Blue"].Points.AddXY(w, his.Garray[w]);

            }
            chart1.Series["Green"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Green"].Color = Color.Green;
            chart1.Series["Red"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Red"].Color = Color.Red;
            chart1.Series["Blue"].ChartType = SeriesChartType.SplineArea;
            chart1.Series["Blue"].Color = Color.Blue;
        }