Beispiel #1
0
        private void ZipVal_ValueChanged(object sender, EventArgs e)
        {
            int val = ZipVal.Value - 100;

            dontHandle = false;
            Value.Text = val.ToString();
            iw.setBitmap(prevImg);
            iw.Contrast(val);
        }
Beispiel #2
0
        private void ZipVal_ValueChanged(object sender, EventArgs e)
        {
            double val = (double)ZipVal.Value / 100.0F;

            dontHandle = false;
            Value.Text = val.ToString();
            iw.setBitmap(prevImg);
            iw.Gamma(ZipVal.Value);
        }
Beispiel #3
0
        private void DrawHistogram(object sender = null, EventArgs e = null)
        {
            HistogramImage.Image.Dispose();
            HistogramImage.Image = new Bitmap(HistogramImage.Width, HistogramImage.Height);

            Graphics gr = Graphics.FromImage(HistogramImage.Image);

            Pen Pen_R    = new Pen(new SolidBrush(Color.FromArgb(100, 255, 0, 0)), x_scale);
            Pen Pen_G    = new Pen(new SolidBrush(Color.FromArgb(100, 0, 255, 0)), x_scale);
            Pen Pen_B    = new Pen(new SolidBrush(Color.FromArgb(100, 0, 0, 255)), x_scale);
            Pen Pen_Grey = new Pen(new SolidBrush(Color.FromArgb(100, 150, 150, 150)), x_scale);

            Brush red_brush = new SolidBrush(Color.FromArgb(100, 200, 0, 0));
            Pen   red       = new Pen(red_brush);

            gr.DrawLine(red, 5, HistogramImage.Height - 9, HistogramImage.Width - 5, HistogramImage.Height - 9);
            gr.DrawString("0", new Font("Arial", 7), red_brush, new PointF(1.0F, hHeight - 10));
            gr.DrawString("255", new Font("Arial", 7), red_brush, new PointF(hWidth - 17, hHeight - 10));
            gr.DrawLine(red, 5, HistogramImage.Height - 9, HistogramImage.Width - 5, HistogramImage.Height - 9);
            gr.DrawString("0", new Font("Arial", 7), red_brush, new PointF(1.0F, hHeight - 10));
            gr.DrawString("255", new Font("Arial", 7), red_brush, new PointF(hWidth - 17, hHeight - 10));

            int val = int.Parse(Level.Text);

            for (int i = 0; i < 256; i++)
            {
                if (Reverse.Checked)
                {
                    if (i < val)
                    {
                        gr.DrawLine(new Pen(Color.FromArgb(100, 150, 150, 150)), i * x_scale + 5, hHeight - 10, i * x_scale + 5, (float)(hHeight - 10 - (float)((float)LUT[3, i] * y_scale)));
                    }
                    else
                    {
                        gr.DrawLine(new Pen(Color.OrangeRed), i * x_scale + 5, hHeight - 10, i * x_scale + 5, (float)(hHeight - 10 - (float)((float)LUT[3, i] * y_scale)));
                    }
                }
                else
                {
                    if (i <= val)
                    {
                        gr.DrawLine(new Pen(Color.OrangeRed), i * x_scale + 5, hHeight - 10, i * x_scale + 5, (float)(hHeight - 10 - (float)((float)LUT[3, i] * y_scale)));
                    }
                    else
                    {
                        gr.DrawLine(new Pen(Color.FromArgb(100, 150, 150, 150)), i * x_scale + 5, hHeight - 10, i * x_scale + 5, (float)(hHeight - 10 - (float)((float)LUT[3, i] * y_scale)));
                    }
                }
            }

            iw.setBitmap(prevImg);
            iw.Treshold(val, Reverse.Checked);

            HistogramImage.Invalidate();
            gr.Dispose();
        }
Beispiel #4
0
 private void ZipVal_ValueChanged(object sender, EventArgs e)
 {
     Value.Text = ZipVal.Value.ToString();
     iw.setBitmap(prevImg);
     iw.Posterize(ZipVal.Value);
 }
Beispiel #5
0
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     iw.setBitmap(prevImage);
     Dispose();
     Close();
 }