private void RenderFractals(Rendering.IGraphics2DContext context)
        {
            Properties.Settings settings = Properties.Settings.Default;

            Rendering.LinearGradientBrush backgroundBrush = new Rendering.LinearGradientBrush();
            backgroundBrush.FromColor = TAlex.BeautifulFractals.Rendering.Color.Parse(settings.PrimaryBackColor);
            backgroundBrush.ToColor   = TAlex.BeautifulFractals.Rendering.Color.Parse(settings.SecondaryBackColor);
            backgroundBrush.Angle     = GetGradientAngle(settings.BackGradientType);

            context.Clear(backgroundBrush);
            Thread.Sleep(_initialDelay);

            Rendering.Font captionFont = new Rendering.Font(settings.CaptionFontFamily, settings.CaptionFontSize);

            while (true)
            {
                foreach (Fractal2D fractal in _fractals)
                {
                    //if (!fractal.FullyFillRendering)
                    {
                        context.Clear(backgroundBrush);
                    }
                    if (settings.ShowFractalCaptions)
                    {
                        context.DrawString(
                            fractal.Caption,
                            captionFont,
                            TAlex.BeautifulFractals.Rendering.Color.Parse(settings.CaptionFontColor),
                            CalculateCaptionPosition(context, fractal.Caption, captionFont));
                    }

                    fractal.Render(context);
                    Thread.Sleep(_delay);
                }
            }
        }
 private Rendering.Point CalculateCaptionPosition(Rendering.IGraphics2DContext context, string caption, Rendering.Font font)
 {
     Rendering.Size captionSize = context.MeasureString(caption, font);
     return(new Rendering.Point(context.Viewport.Width / 2 - captionSize.Width / 2, context.Viewport.Height - CaptionMarginBottom - captionSize.Height));
 }