예제 #1
0
        public static Bitmap Sharpen(Bitmap img, int nWeight /* default to 11*/)
        {
            Bitmap     b = (Bitmap)img.Clone();
            ConvMatrix m = new ConvMatrix();

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

            if (Conv3x3(b, m))
            {
                if (Rounded)
                {
                    RoundImage(b, 30);
                }

                return(b);
            }

            else
            {
                return(null);
            }
        }
예제 #2
0
        public static void GaussianBlur(Bitmap img, int nWeight)
        {
            Bitmap     b = img;
            ConvMatrix m = new ConvMatrix();

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

            if (Conv3x3(b, m))
            {
                //if (Rounded)
                //    RoundImage(b, 30);
            }
        }