/// <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;
}