private Bitmap ScVxButton_PostTreatmentEffectGDI(object sender, Bitmap backBitmap) { //if (effectBitmap != null) //{ // effectBitmap.Dispose(); // effectBitmap = null; //} if (effectBitmap == null) { Bitmap lightBitmap = (Bitmap)backBitmap.Clone(); ColorDisplace.Displace(lightBitmap, selectHaloColor); GaussianBlur gs = new GaussianBlur(10); effectBitmap = gs.ProcessImage(lightBitmap); lightBitmap.Dispose(); } Bitmap bmp = (Bitmap)effectBitmap.Clone(); Graphics g = Graphics.FromImage(bmp); g.DrawImage(backBitmap, 0, 0); g.Dispose(); return(bmp); }
public void ClearBitmapRect(RectangleF clipRect) { if (bitmap != null && controlType == ControlType.UPDATELAYERFORM) { Rectangle rc = new Rectangle((int)clipRect.Left, (int)clipRect.Top, (int)clipRect.Width, (int)clipRect.Height); ColorDisplace.Displace(bitmap, Color.FromArgb(0, 0, 0, 0), rc, true); } }