private void ProcessMandelbrot(MandelbrotTask task)
        {
            // work in chunks of 20 - why 20? No good reason - sorry.
            for (int i = 0; i < 20; i++)
            {
                if (task.Mandelbrot.IsScaleComplete)
                {
                    var final = task.Mandelbrot.Bitmap.Clone();
                    task.CopyComplete(final);
                    return;
                }

                if (task.CancelFlag)
                    return;

                if (task.CopyFlag)
                {
                    var bitmap = task.Mandelbrot.Bitmap.Clone();
                    task.CopyComplete(bitmap);
                }

                task.Mandelbrot.NextLine();
            }

            ProcessAsync();
        }
        private void ProcessMandelbrot(MandelbrotTask task)
        {
            // work in chunks of 20 - why 20? No good reason - sorry.
            for (int i = 0; i < 20; i++)
            {
                if (task.Mandelbrot.IsScaleComplete)
                {
                    var final = task.Mandelbrot.Bitmap.Clone();
                    task.CopyComplete(final);
                    return;
                }

                if (task.CancelFlag)
                {
                    return;
                }

                if (task.CopyFlag)
                {
                    var bitmap = task.Mandelbrot.Bitmap.Clone();
                    task.CopyComplete(bitmap);
                }

                task.Mandelbrot.NextLine();
            }

            ProcessAsync();
        }