Esempio n. 1
0
 public MaskMatrix(MDIForm f)
 {
     InitializeComponent();
     form   = f;
     Before = f.img.Clone();
     AfterPictureBox.Image  = f.img.bitmap;
     BeforePictureBox.Image = f.img.bitmap;
 }
Esempio n. 2
0
 public MaskMatrix(MDIForm f)
 {
     InitializeComponent();
     form = f;
     Before = f.img.Clone();
     AfterPictureBox.Image = f.img.bitmap;
     BeforePictureBox.Image = f.img.bitmap;
 }
Esempio n. 3
0
        private void GrayScale_Click(object sender, EventArgs e)
        {
            MDIForm f = ((MDIForm)ActiveMdiChild);

            f.img = ImageOperation.GrayScale(f.img);
            //f.UpdateTMP();
            generateHistogram(f.img, chart1);
            //generateHistogram(f.tmp, chart2);
        }
Esempio n. 4
0
        public OperationsForm( MDIForm f, string operation = "")
        {
            InitializeComponent();
            form =  f;

            this.Text = operation;
            decimal x = Math.Round((Decimal)AfterPictureBox.Width / f.img.Width, 2, MidpointRounding.AwayFromZero);
            decimal y = Math.Round((Decimal)AfterPictureBox.Height / f.img.Height, 2, MidpointRounding.AwayFromZero);
            After = ImageOperation.TransformImage(f.img, 0, 0, 0,(float)x ,(float)y );
            Before = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            this.BeforePictureBox.Image = Before.bitmap;
            this.AfterPictureBox.Image = After.bitmap;

            if (operation == "Contrast")
            { Slider.Maximum = 50; Slider.Minimum = -50; }
        }
Esempio n. 5
0
        public OperationsForm(MDIForm f, string operation = "")
        {
            InitializeComponent();
            form = f;

            this.Text = operation;
            decimal x = Math.Round((Decimal)AfterPictureBox.Width / f.img.Width, 2, MidpointRounding.AwayFromZero);
            decimal y = Math.Round((Decimal)AfterPictureBox.Height / f.img.Height, 2, MidpointRounding.AwayFromZero);

            After  = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            Before = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            this.BeforePictureBox.Image = Before.bitmap;
            this.AfterPictureBox.Image  = After.bitmap;

            if (operation == "Contrast")
            {
                Slider.Maximum = 50; Slider.Minimum = -50;
            }
        }
Esempio n. 6
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title       = "Open Image";
            dialog.Multiselect = false;
            dialog.Filter      = "Images (*.BMP;*.JPG;*.GIF,*.PNG,*.TIFF,*.PPM)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF;*.PPM|" +
                                 "All files (.)|*.*";
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string path = dialog.FileName;

                img = ImageLoader.LoadImage(path);
                if (img != null)
                {
                    MDIForm f = new MDIForm(ref img, this);
                }
            }
        }
Esempio n. 7
0
        public OperationsForm(MDIForm f, Operations op)
        {
            InitializeComponent();
            Op   = op;
            form = f;
            decimal x = Math.Round((Decimal)AfterPictureBox.Width / f.img.Width, 2, MidpointRounding.AwayFromZero);
            decimal y = Math.Round((Decimal)AfterPictureBox.Height / f.img.Height, 2, MidpointRounding.AwayFromZero);

            After  = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            Before = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            this.BeforePictureBox.Image = Before.bitmap;
            this.AfterPictureBox.Image  = After.bitmap;

            if (Op == Operations.Contrast)
            {
                Slider.Maximum            = 50; Slider.Minimum = -50;
                this.Text                 = "Contrast";
                this.MaskGroupBox.Visible = false;
                ApplyButton.Visible       = false;
                RadioButton1D.Visible     = false;
                RadioButton2D.Visible     = false;
            }
            else if (Op == Operations.Brighthness)
            {
                this.Text             = "Brighthness";
                MaskGroupBox.Visible  = false;
                RadioButton1D.Visible = false;
                RadioButton2D.Visible = false;
                ApplyButton.Visible   = false;
                RadioButton1D.Visible = false;
                RadioButton2D.Visible = false;
            }
            else if (Op == Operations.MeanFilter)
            {
                this.Text      = "Mean Filter";
                Slider.Visible = false;
            }
        }
Esempio n. 8
0
        public OperationsForm( MDIForm f, Operations op)
        {
            InitializeComponent();
            Op = op;
            form =  f;
            decimal x = Math.Round((Decimal)AfterPictureBox.Width / f.img.Width, 2, MidpointRounding.AwayFromZero);
            decimal y = Math.Round((Decimal)AfterPictureBox.Height / f.img.Height, 2, MidpointRounding.AwayFromZero);
            After = ImageOperation.TransformImage(f.img, 0, 0, 0,(float)x ,(float)y );
            Before = ImageOperation.TransformImage(f.img, 0, 0, 0, (float)x, (float)y);
            this.BeforePictureBox.Image = Before.bitmap;
            this.AfterPictureBox.Image = After.bitmap;

            if (Op == Operations.Contrast)
            {
                Slider.Maximum = 50; Slider.Minimum = -50;
                this.Text = "Contrast";
                this.MaskGroupBox.Visible = false;
                ApplyButton.Visible = false;
                RadioButton1D.Visible = false;
                RadioButton2D.Visible = false;
            }
            else if(Op==Operations.Brighthness)
            {
                this.Text = "Brighthness";
                MaskGroupBox.Visible = false;
                RadioButton1D.Visible = false;
                RadioButton2D.Visible = false;
                ApplyButton.Visible = false;
                RadioButton1D.Visible = false;
                RadioButton2D.Visible = false;
            }
            else if(Op==Operations.MeanFilter)
            {
                this.Text = "Mean Filter";
                Slider.Visible = false;
            }
        }
Esempio n. 9
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            dialog.Title = "Open Image";
            dialog.Multiselect = false;
            dialog.Filter = "Images (*.BMP;*.JPG;*.GIF,*.PNG,*.TIFF,*.PPM)|*.BMP;*.JPG;*.GIF;*.PNG;*.TIFF;*.PPM|" +
                            "All files (.)|*.*";
            DialogResult result = dialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                string path = dialog.FileName;

                img = ImageLoader.LoadImage(path);
                if (img != null)
                {
                    MDIForm f = new MDIForm(ref img, this);

                }
            }
        }