private void DoTest(TestCase test)
        {
            var canvas = new Canvas();
            canvas.Width = 300;
            canvas.Height = 700;
            ICanvasRenderingContext2D ctx = new CanvasRenderingContext2D(canvas, this, true);
            string url = test(ctx);
            ctx.commit();
            string location = Application.ResourceAssembly.Location;
            string path = location.Remove(location.LastIndexOf("\\"));

            var di = new DirectoryInfo(path);
            url = di.Parent.Parent.Parent.FullName + "\\SharpCanvas.Tests\\" + url;
            if (File.Exists(url))
            {
                pctOriginal.Source = new BitmapImage(new Uri(url));
                pctOriginal.Visibility = Visibility.Visible;
            }
            else
            {
                pctOriginal.Visibility = Visibility.Hidden;
            }
            ctResults.Children.Clear();
            ctResults.Children.Add(canvas);
        }
        public void flyMe(CanvasRenderingContext2D ctx, int i)
        {
            container.Children.Clear();

            ctx.save();
            ctx.translate(0, Math.Cos(i*0.1)*40);

            double a = Math.Sin(i*0.1);

            // right wing
            ctx.save();
            ctx.rotate(Math.PI*0.4);
            wing(ctx, 8, a);

            ctx.commit();

            ctx.restore();

            // left wing
            ctx._path.GetNumberOfCommits();
            ctx._path.GetNumberOfPaths();

            ctx.save();
            ctx.scale(-1, 1);
            ctx.rotate(Math.PI*0.4);
            wing(ctx, 8, a);

            ctx.commit();

            ctx.restore();

            Debugger.Log(0, "Timing", "Left wing, Commits:" + ctx._path.GetNumberOfCommits());
            Debugger.Log(0, "Timing", "Left wing, Paths:" + ctx._path.GetNumberOfPaths());

            // tail
            ctx.save();
            tail(ctx, 10, Math.Sin(i*0.05));
            ctx.commit();
            ctx.restore();

            // head
            neck(ctx, 12);
            ctx.commit();
            ctx.restore();
        }