示例#1
0
        /// <summary>
        /// Gaussians the blur.
        /// </summary>
        /// <param name="b">The b.</param>
        /// <param name="nWeight">The n weight.</param>
        /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
        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));
        }
示例#2
0
        /// <summary>
        /// Draws the blur.
        /// </summary>
        public void DrawBlur()
        {
            Bitmap bmp = Screenshot.TakeSnapshot(control);

            BitmapFilter.GaussianBlur(bmp, blurLevel);

            PictureBox pb = new PictureBox();

            pb.Size     = control.Size;
            pb.Location = control.Location;

            control.FindForm().Controls.Add(pb);

            //panel1.Controls.Add(pb);
            pb.Image    = bmp;
            pb.SizeMode = PictureBoxSizeMode.AutoSize;
            //pb.Dock = DockStyle.Fill;
            pb.BringToFront();
            //panel.BringToFront();
        }