コード例 #1
0
ファイル: Form1.cs プロジェクト: simedcn/dipprocess
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
            }
            else if(comboBox1.SelectedIndex==0)
            {
                if (pictureBox1.Image != null)
                {
                    //pictureBox2.Image = Trans.ZhiFangtu(0);
                    //pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
                    ////AdaptePictureSize(pictureBox2);
                    //Update();
                    //pictureBox3.Image = Trans.ZhiFangtu(1);
                    //AdaptePictureSize(pictureBox3);
                    //Update();
                    //pictureBox4.Image = Trans.ZhiFangtu(2);
                    //AdaptePictureSize(pictureBox4);
                    //Update();
                    int[,] result = Trans.ZhiFangtu2();
                    //result.CopyTo(re, 0);
                    GraphicBar br = new GraphicBar(Color.Blue, Color.White, result, 0);
                    GraphicBar gr = new GraphicBar(Color.Green, Color.White, result, 1);
                    GraphicBar rr = new GraphicBar(Color.Red, Color.White, result, 2);

                    this.panel1.Controls.Clear();

                    br.Dock = DockStyle.Top;
                    gr.Dock = DockStyle.Top;
                    rr.Dock = DockStyle.Top;
                    //br.SetPic(Trans.splite(0));

                    this.panel1.Controls.Add(br);
                    panel1.Controls.Add(gr);
                    panel1.Controls.Add(rr);

                }
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                //panel1.Invalidate();
                //SpliteRGB();

                if (pictureBox1.Image != null)
                {
                //    panel1.Controls.Clear();
                //    GraphicBar br = new GraphicBar((Bitmap)Trans.splite(0));
                //    br.Dock = DockStyle.Top;
                //    panel1.Controls.Add(br);

                //    GraphicBar gr = new GraphicBar((Bitmap)Trans.splite(1));
                //    gr.Dock = DockStyle.Top;
                //    panel1.Controls.Add(gr);

                //    GraphicBar rr = new GraphicBar((Bitmap)Trans.splite(2));
                //    rr.Dock = DockStyle.Top;
                //    panel1.Controls.Add(rr);
                    //Update();
                    panel1.Controls.Clear();
                    panel1.Controls.Add(pictureBox2);
                    panel1.Controls.Add(pictureBox3);
                    panel1.Controls.Add(pictureBox4);
                    panel1.Controls.Add(label2);
                    panel1.Controls.Add(label3);
                    panel1.Controls.Add(label4);
                }
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: simedcn/dipprocess
        private void 直方图ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //this.pictureBox5.Image = Trans.ZhiFangtu(3);
            //AdaptePictureSize(pictureBox5);

            ////pictureBox5.SizeMode = PictureBoxSizeMode.StretchImage;
            //Update();
            int[,] result=Trans.ZhiFangtu2();
            //result.CopyTo(re, 0);
            GraphicBar br=new GraphicBar (Color.Black,Color.White,result,3);
            splitContainer1.Panel2.Controls.Clear();
            br.Dock = DockStyle.Top;
            splitContainer1.Panel2.Controls.Add(br);
        }