Ejemplo n.º 1
0
        public WindowBrightnessContrast(WindowPicture wnd, Modification mt)
        {
            InitializeComponent();

            mod = new RawImage((Bitmap)wnd.Image);
            pic = wnd;
            original = new RawImage((Bitmap)wnd.Image);
            type = mt;
            apply = false;

            switch (mt)
            {
                case Modification.Brightness:
                    tb.Minimum = -255;
                    tb.Maximum = 255;
                    tb.Value = 0;
                    Text = label1.Text = "Brightness";
                    break;
                case Modification.Contrast:
                    tb.Maximum = 50;
                    tb.Minimum = -50;
                    tb.Value = 0;
                    Text = label1.Text = "Contrast";
                    break;
                case Modification.Gamma:
                    tb.Minimum = 10;
                    tb.Maximum = 200;
                    Text = label1.Text = "Gamma";
                    tb.Value = 100;
                    break;
                case Modification.Exposition:
                    tb.Minimum = -2000;
                    tb.Maximum = 2000;
                    tb.Value = 0;
                    Text = label1.Text = "Exposition";
                    break;
                case Modification.Threshold:
                    tb.Minimum = 0;
                    tb.Maximum = 255;
                    tb.Value = 128;
                    Text = label1.Text = "Threshold";
                    break;
            }
        }
Ejemplo n.º 2
0
        public WindowConvultion(WindowPicture wnd)
        {
            InitializeComponent();

            filter = new int[5, 5];
            filter[3, 3] = 1;

            pic = wnd;
            mod = new RawImage((Bitmap) wnd.Image);
            original = new RawImage((Bitmap) wnd.Image);

            for (int i = 0; i < 5; ++i)
                filterData.Columns.Add("", "");

            for (int i = 0; i < 5; ++i)
                filterData.Rows.Add(0, 0, 0, 0, 0);

            filterData[2, 2].Value = 1;

            filterData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            filterData.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;
            filterData.ColumnHeadersVisible = false;
        }
Ejemplo n.º 3
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if ( openDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         WindowPicture pic = new WindowPicture();
         pic.SetImage(openDialog.FileName);
         pic.File = openDialog.SafeFileName;
         pic.MdiParent = this;
         pic.Show();
     }
 }
Ejemplo n.º 4
0
        private void nudColorize(WindowPicture pic)
        {
            if ((int)nudWidth.Value < pic.Image.Width)
            {
                nudWidth.BackColor = Color.Green;
            }
            else if ((int)nudWidth.Value > pic.Image.Width)
            {
                nudWidth.BackColor = Color.Red;
            }
            else
                nudWidth.BackColor = Color.White;

            if ((int)nudHeight.Value < pic.Image.Height)
            {
                nudHeight.BackColor = Color.Green;
            }
            else if ((int)nudHeight.Value > pic.Image.Height)
            {
                nudHeight.BackColor = Color.Red;
            }
            else
                nudHeight.BackColor = Color.White;
        }