Ejemplo n.º 1
0
        private void GenerateButton_Click(object sender, RoutedEventArgs e)
        {
            var clock = CreateClock();

            var width  = int.Parse(WidthCanvas.Text);
            var height = int.Parse(HeightCanvas.Text);

            RTF.Canvas canvas = ConvertPointsToCanvas(clock, width, height);

            string filename = $"{FolderPath.Text}\\Clock[{WidthCanvas.Text}x{HeightCanvas.Text}].ppm";

            canvas.SaveAsPPMFile(filename);
        }
Ejemplo n.º 2
0
        private void GenerateButton_Click(object sender, RoutedEventArgs e)
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            GenerateButton.IsEnabled = false;
            var canvasSize = new Tuple <int, int>(int.Parse(WidthCanvas.Text), int.Parse(HeightCanvas.Text));

            RTCf.Canvas canvas = GenerateProjectile(canvasSize.Item1, canvasSize.Item2);


            watch.Stop();
            var    elapsedMs = watch.ElapsedMilliseconds;
            string filename  = $"{FolderPath.Text}\\{FileName.Text}[{WidthCanvas.Text}x{HeightCanvas.Text}][{VelocityX.Text},{VelocityY.Text},{VelocityZ.Text}][{Magnetude.Text}] [{elapsedMs}ms].ppm";

            canvas.SaveAsPPMFile(filename);
            GenerateButton.IsEnabled = true;
        }