Exemple #1
0
 private void menuItem2_Click(object sender, EventArgs e)
 {
     pictureBox2.Image = BitmapFilter.Laplacian3x3Filter(m_Bitmap, false);
     pictureBox2.Refresh();
     pictureBox2.Invalidate();
     SetHistogram(2);
 }
Exemple #2
0
 private void menuItem2_Click_1(object sender, EventArgs e)
 {
     pictureBox2.Image = BitmapFilter.equalizing(m_Bitmap);
     pictureBox2.Refresh();
     pictureBox2.Invalidate();
     SetHistogram(2);
 }
Exemple #3
0
 private void menuItem11_Click(object sender, EventArgs e)
 {
     pictureBox2.Image = BitmapFilter.Errosion((Bitmap)pictureBox1.Image, 3);
     pictureBox2.Refresh();
     pictureBox2.Invalidate();
     SetHistogram(2);
 }
Exemple #4
0
 private void Filter_GrayScale(object sender, System.EventArgs e)
 {
     pictureBox2.Image = BitmapFilter.GrayScale(m_Bitmap);
     pictureBox2.Refresh();
     pictureBox2.Invalidate();
     SetHistogram(2);
 }
Exemple #5
0
 private void swirlAntiAlias_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Swirl(m_Bitmap, .04, true))
     {
         this.Invalidate();
     }
 }
Exemple #6
0
 private void OnEmbossLaplacian(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.EmbossLaplacian(m_Bitmap))
     {
         this.Invalidate();
     }
 }
Exemple #7
0
 private void OnEdgeDetectQuick(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.EdgeDetectQuick(m_Bitmap))
     {
         this.Invalidate();
     }
 }
Exemple #8
0
 private void randomJitter_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.RandomJitter(m_Bitmap, 5))
     {
         this.Invalidate();
     }
 }
Exemple #9
0
 private void Filter_GrayScale(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.GrayScale(m_Bitmap))
     {
         this.Invalidate();
     }
 }
Exemple #10
0
 private void sphereAntialias_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Sphere(m_Bitmap, true))
     {
         this.Invalidate();
     }
 }
Exemple #11
0
 private void waterAntialias_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Water(m_Bitmap, 15, false))
     {
         this.Invalidate();
     }
 }
Exemple #12
0
 private void PixelateGrid_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Pixelate(m_Bitmap, 15, true))
     {
         this.Invalidate();
     }
 }
Exemple #13
0
 private void timeWarpAntiAlias_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.TimeWarp(m_Bitmap, 15, true))
     {
         this.Invalidate();
     }
 }
Exemple #14
0
 private void Moire_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Moire(m_Bitmap, 3))
     {
         this.Invalidate();
     }
 }
Exemple #15
0
 private void menuItem11_Click_1(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Sphere(m_Bitmap, false))
     {
         this.Invalidate();
     }
 }
Exemple #16
0
 private void OnMeanRemoval(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.MeanRemoval(m_Bitmap, 9))
     {
         this.Invalidate();
     }
 }
Exemple #17
0
 private void OnGaussianBlur(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.GaussianBlur(m_Bitmap, 4))
     {
         this.Invalidate();
     }
 }
Exemple #18
0
 private void OnSharpen(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Sharpen(m_Bitmap, 11))
     {
         this.Invalidate();
     }
 }
Exemple #19
0
 private void flipBoth_Click(object sender, System.EventArgs e)
 {
     m_Undo = (Bitmap)m_Bitmap.Clone();
     if (BitmapFilter.Flip(m_Bitmap, true, true))
     {
         this.Invalidate();
     }
 }
        public static bool MeanRemoval(Bitmap b, int nWeight /* default to 9*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(-1);
            m.Pixel  = nWeight;
            m.Factor = nWeight - 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
        public static bool Smooth(Bitmap b, int nWeight /* default to 1 */)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(1);
            m.Pixel  = nWeight;
            m.Factor = nWeight + 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
        public static bool Sharpen(Bitmap b, int nWeight /* default to 11*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(0);
            m.Pixel  = nWeight;
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = -2;
            m.Factor = nWeight - 8;

            return(BitmapFilter.Conv3x3(b, m));
        }
        public static bool GaussianBlur(Bitmap b, int nWeight /* default to 4*/)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(1);
            m.Pixel  = nWeight;
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 2;
            m.Factor = nWeight + 12;

            return(BitmapFilter.Conv3x3(b, m));
        }
Exemple #24
0
        private void menuItem2_Click_2(object sender, EventArgs e)
        {
            TresholdInput dlg = new TresholdInput(this);

            if (DialogResult.OK == dlg.ShowDialog())
            {
                pictureBox2.Image = BitmapFilter.TresholdFilter(m_Bitmap, dlg.treshold);
                pictureBox2.Refresh();
                pictureBox2.Invalidate();
            }
        }
Exemple #25
0
        public static bool EmbossLaplacian(Bitmap b)
        {
            ConvMatrix m = new ConvMatrix();

            m.SetAll(-1);
            m.TopMid = m.MidLeft = m.MidRight = m.BottomMid = 0;
            m.Pixel  = 4;
            m.Offset = 127;

            return(BitmapFilter.Conv3x3(b, m));
        }
Exemple #26
0
        public static bool EdgeDetectQuick(Bitmap b)
        {
            ConvMatrix m = new ConvMatrix();

            m.TopLeft    = m.TopMid = m.TopRight = -1;
            m.MidLeft    = m.Pixel = m.MidRight = 0;
            m.BottomLeft = m.BottomMid = m.BottomRight = 1;

            m.Offset = 127;

            return(BitmapFilter.Conv3x3(b, m));
        }
Exemple #27
0
        private void menuItem3_Click(object sender, EventArgs e)
        {
            RobertsInput dlg = new RobertsInput();

            if (DialogResult.OK == dlg.ShowDialog())
            {
                pictureBox2.Image = BitmapFilter.RobertsPic(m_Bitmap, dlg.gams);
                pictureBox2.Refresh();
                pictureBox2.Invalidate();
                SetHistogram(2);
            }
        }
Exemple #28
0
        private void Filter_Invert(object sender, System.EventArgs e)
        {
            //m_Undo = m_Bitmap.Clone() as Bitmap;
            //if (m_Undo == null)
            //    return;
            m_Undo = (Bitmap)m_Bitmap.Clone();

            if (BitmapFilter.Invert(m_Bitmap))
            {
                this.Invalidate();
            }
        }
Exemple #29
0
        private void Filter_Gamma(object sender, System.EventArgs e)
        {
            GammaInput dlg = new GammaInput();

            if (DialogResult.OK == dlg.ShowDialog())
            {
                pictureBox2.Image = BitmapFilter.Gamma(m_Bitmap, dlg.gams);
                pictureBox2.Refresh();
                pictureBox2.Invalidate();
                SetHistogram(2);
            }
        }
Exemple #30
0
        private void menuItem10_Click(object sender, EventArgs e)
        {
            MedianInput dlg = new MedianInput();

            if (DialogResult.OK == dlg.ShowDialog())
            {
                pictureBox2.Image = BitmapFilter.MedianFilter((Bitmap)pictureBox1.Image, dlg.gams);
                pictureBox2.Refresh();
                pictureBox2.Invalidate();
                SetHistogram(2);
            }
        }