protected Dispose ( bool disposing ) : void | ||
disposing | bool | true if managed resources should be disposed; otherwise, false. |
return | void |
/// <summary> /// Apply all images to a blur filter /// </summary> private void BlurAll_Click(object sender, EventArgs e) { #region Reset and Undo Properties btnUndo.Enabled = true; btnReset.Enabled = true; _listFramesUndo.Clear(); _listFramesUndo = new List<Bitmap>(_listFramesPrivate); _listDelayUndo.Clear(); _listDelayUndo = new List<int>(_listDelayPrivate); #endregion ValuePicker valuePicker = new ValuePicker(5, 1, Resources.Msg_BlurIntense); if (valuePicker.ShowDialog() == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; //This thing down here didn't make any difference. Still hangs. // http://www.codeproject.com/Articles/45787/Easy-asynchronous-operations-with-AsyncVar Oh, I see now, this thing it's good only with multiple actions. var asyncVar = new AsyncVar<List<Bitmap>>( () => ImageUtil.Blur(_listFramesPrivate, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), valuePicker.Value)); //_listFramesPrivate = ImageUtil.Blur(_listFramesPrivate, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), valuePicker.Value); _listFramesPrivate = new List<Bitmap>(asyncVar.Value); pictureBitmap.Image = _listFramesPrivate[trackBar.Value]; this.Cursor = Cursors.Default; } valuePicker.Dispose(); btnReset.Enabled = true; }
/// <summary> /// Apply all images to a Pixelated filter /// </summary> private void PixelateAll_Click(object sender, EventArgs e) { #region Reset and Undo Properties btnUndo.Enabled = true; btnReset.Enabled = true; _listFramesUndo.Clear(); _listFramesUndo = new List<Bitmap>(_listFramesPrivate); _listDelayUndo.Clear(); _listDelayUndo = new List<int>(_listDelayPrivate); #endregion ValuePicker valuePicker = new ValuePicker(100, 2, Resources.Msg_PixelSize); if (valuePicker.ShowDialog() == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; _listFramesPrivate = ImageUtil.Pixelate(_listFramesPrivate, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), valuePicker.Value); pictureBitmap.Image = _listFramesPrivate[trackBar.Value]; this.Cursor = Cursors.Default; } valuePicker.Dispose(); btnReset.Enabled = true; }
/// <summary> /// Apply selected image to a blur filter /// </summary> private void BlurOne_Click(object sender, EventArgs e) { #region Reset and Undo Properties btnUndo.Enabled = true; btnReset.Enabled = true; _listFramesUndo.Clear(); _listFramesUndo = new List<Bitmap>(_listFramesPrivate); _listDelayUndo.Clear(); _listDelayUndo = new List<int>(_listDelayPrivate); #endregion ValuePicker valuePicker = new ValuePicker(5, 1, Resources.Msg_BlurIntense); if (valuePicker.ShowDialog() == DialogResult.OK) { _listFramesPrivate[trackBar.Value] = ImageUtil.Blur((Bitmap)pictureBitmap.Image, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), valuePicker.Value); pictureBitmap.Image = _listFramesPrivate[trackBar.Value]; } valuePicker.Dispose(); btnReset.Enabled = true; }
/// <summary> /// Apply selected image to a pixelated filter /// </summary> private void PixelateOne_Click(object sender, EventArgs e) { #region Reset and Undo Properties btnUndo.Enabled = true; btnReset.Enabled = true; _listFramesUndo.Clear(); _listFramesUndo = new List<Bitmap>(_listFramesPrivate); _listDelayUndo.Clear(); _listDelayUndo = new List<int>(_listDelayPrivate); #endregion //User first need to choose the intensity of the pixelate ValuePicker valuePicker = new ValuePicker(100, 2, Resources.Msg_PixelSize); if (valuePicker.ShowDialog() == DialogResult.OK) //Should I keep everything inside here? (the undo and reset stuff) { _listFramesPrivate[trackBar.Value] = ImageUtil.Pixelate((Bitmap)pictureBitmap.Image, new Rectangle(0, 0, pictureBitmap.Image.Width, pictureBitmap.Image.Height), valuePicker.Value); pictureBitmap.Image = _listFramesPrivate[trackBar.Value]; } valuePicker.Dispose(); btnReset.Enabled = true; }
/// <summary> /// Apply selected image to a blur filter /// </summary> private void Blur_Click(object sender, EventArgs e) { const string filterLabel = "Blur filter"; var valuePicker = new ValuePicker(5, 1, Resources.Msg_BlurIntense); if (valuePicker.ShowDialog() == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; panelEdit.Enabled = false; panelBottom.Enabled = false; filterDel = ApplyActionToFrames; filterDel.BeginInvoke(filterLabel, ActionEnum.Blur, valuePicker.Value, null, CallBackFilter, null); } valuePicker.Dispose(); }
/// <summary> /// Apply selected image to a pixelated filter /// </summary> private void Pixelate_Click(object sender, EventArgs e) { const string filterLabel = "Pixelate filter"; //User first need to choose the intensity of the pixelate var valuePicker = new ValuePicker(100, 2, Resources.Msg_PixelSize); if (valuePicker.ShowDialog() == DialogResult.OK) { this.Cursor = Cursors.WaitCursor; panelEdit.Enabled = false; panelBottom.Enabled = false; filterDel = ApplyActionToFrames; filterDel.BeginInvoke(filterLabel, ActionEnum.Pixelate, valuePicker.Value, null, CallBackFilter, null); } valuePicker.Dispose(); }