示例#1
0
        private void btn_apply_Click(object sender, EventArgs e)
        {
            NeighborOperations Filters = new NeighborOperations();
            Picture pic = new Picture();

               Color [,] input = pic.Buffering(temp);

            if (type_v == 1)
            { //mean filter
                Color[,] Result = Filters.MeanFilter(input, int.Parse(MaskWidth.Text), int.Parse(MaskHeight.Text), int.Parse(OrignX.Text), int.Parse(OriginY.Text));
                temp = pic.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1));
                pic_modified.Image = temp;

            }
            else if (type_v == 2)
            { //gaussian option1
                Color[,] Result = Filters.GaussianFilter1(input,int.Parse(MaskWidth.Text),double.Parse(Sigma.Text),int.Parse(OrignX.Text), int.Parse(OriginY.Text));
                temp = pic.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1));
                pic_modified.Image = temp;
            }
            else if (type_v == 3)
            { //gaussian option2

                Color[,] Result = Filters.GaussianFilter2(input, double.Parse(Sigma.Text), int.Parse(OrignX.Text), int.Parse(OriginY.Text));

                temp = pic.convert_Buffer_to_Bitmap(Result, Result.GetLength(0), Result.GetLength(1));
                pic_modified.Image = temp;
            }
        }
示例#2
0
文件: Form1.cs 项目: ahmedelkashef/GP
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     p = new Picture();
     string path = p.showDialog();
     if (path != null)
     {
         string[] seperator = { "\\" };
         string[] arr = path.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
         string img_name = arr[arr.Length - 1];
         b = new Bitmap(path);
         path = null;
         org_Buffer = p.Buffering(b);
         final_image = org_Buffer;
         //pictureBox25.Image = b;
         ControlTab.Visible = true;
         create_tabPage(b, img_name);
     }
 }