void ClearPreview() { renderer.CancelAsync(); lock ( redrawLock ) { previewImage = null; preview.Image = null; } }
void ClearPreview() { string stack = Environment.StackTrace; Debug.WriteLine("ClearPreview() @ " + stack.Substring(0, stack.IndexOf("at System.Windows.Forms.Control.WndProc"))); renderer.CancelAsync(); lock ( redrawLock ) { previewImage = null; preview.Image = null; } }
void Redraw(bool drawAgain) { lock ( redrawLock ) { progressBar.Visible = true; progressBar.Style = ProgressBarStyle.Continuous; if (bwRenderer.IsBusy) { renderer.CancelAsync(); bwRenderer.CancelAsync(); while (bwRenderer.IsBusy) { Thread.Sleep(1); Application.DoEvents(); } } if (drawAgain) { renderer.Rotation = previewRotation; bwRenderer.RunWorkerAsync(); } } }