Beispiel #1
0
        public static Image PrintScreen(Form mainFormRef)
        {
            Bitmap bmp = Screenshot.TakeSnapshot(mainFormRef);

            BitmapFilter.GaussianBlur(bmp, 1);

            if (blurMapRenderCount >= 3)
            {
                blurMapRenderCount = 0;
                System.GC.Collect();
            }
            blurMapRenderCount++;
            return(bmp);
        }
Beispiel #2
0
        public static bool GaussianBlur(Bitmap b, int nWeight /* default to 4*/)
        {
            if (b == null)
            {
                return(false);
            }
            ConvMatrix m = new ConvMatrix();

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

            m.Factor = nWeight + 21;
            BitmapFilter.Conv3x3(b, m);
            m.Factor = nWeight + 11;
            BitmapFilter.Conv3x3(b, m);
            m.Factor = nWeight + 20;
            return(BitmapFilter.Conv3x3(b, m));
        }