Ejemplo n.º 1
0
        private async void ExportAnimationToGifToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileTools.TryOpenSaveFileDialog(out string fileName, "GIF|*.gif", "animation");

            var progressViewer = new ProgressViewer {
                Text = "Processing GIF"
            };

            progressViewer.Show();
            var progress = new Progress <int>(percent =>
                                              progressViewer.SetProgress(percent));

            await modelViewport.RenderAnimationToGifAsync(fileName, progress);

            progressViewer.Close();
        }
Ejemplo n.º 2
0
        public static async Task ConvertAnimationToGif(ModelViewport viewport)
        {
            if (!viewport.HasAnimation)
            {
                MessageBox.Show("Please open an animation file and select an animation.", "No animation selected");
                return;
            }

            FileTools.TryOpenSaveFileDialog(out string fileName, "GIF|*.gif", "animation");

            var progressViewer = new ProgressViewer {
                Text = "Processing GIF"
            };

            progressViewer.Show();
            var progress = new Progress <int>(percent =>
                                              progressViewer.SetProgress(percent));

            await viewport.RenderAnimationToGifAsync(fileName, progress);

            progressViewer.Close();
        }
Ejemplo n.º 3
0
        public static void ExportFramesToFolder(ModelViewport viewport)
        {
            if (!viewport.HasAnimation)
            {
                MessageBox.Show("Please open an animation file and select an animation.", "No animation selected");
                return;
            }

            FileTools.TryOpenFolderDialog(out string folderPath, "animation");

            var progressViewer = new ProgressViewer {
                Text = "Processing Animation"
            };

            progressViewer.Show();
            var progress = new Progress <int>(percent =>
                                              progressViewer.SetProgress(percent));

            viewport.RenderAnimationToFolder(folderPath);

            progressViewer.Close();
        }