Example #1
0
        // --------------------------------------------------------------------------------------------------------


        /// <summary>
        /// FFmpeg Generate Script
        /// </summary>
        public static void FFmpegScript(MainWindow mainwindow)
        {
            // Clear Old Text
            ScriptView.ClearScriptView(mainwindow);
            //ScriptView.scriptParagraph.Inlines.Clear();

            // Write FFmpeg Args
            mainwindow.rtbScriptView.Document = new FlowDocument(ScriptView.scriptParagraph);
            mainwindow.rtbScriptView.BeginChange();
            ScriptView.scriptParagraph.Inlines.Add(new Run(ffmpegArgs));
            mainwindow.rtbScriptView.EndChange();
        }
Example #2
0
        // --------------------------------------------------------------------------------------------------------


        /// <summary>
        /// FFmpeg Generate Script
        /// </summary>
        public static void FFmpegScript(MainWindow mainwindow, ScriptView scriptview)
        {
            // Detect which screen we're on
            var allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
            var thisScreen = allScreens.SingleOrDefault(s => mainwindow.Left >= s.WorkingArea.Left && mainwindow.Left < s.WorkingArea.Right);

            // Start Window
            scriptview = new ScriptView(mainwindow);

            // Position Relative to MainWindow
            // Keep from going off screen
            scriptview.Left = Math.Max((mainwindow.Left + (mainwindow.Width - scriptview.Width) / 2), thisScreen.WorkingArea.Left);
            scriptview.Top  = Math.Max(((mainwindow.Top + (mainwindow.Height - scriptview.Height) * 2)), thisScreen.WorkingArea.Top);

            // Open Window
            scriptview.Show();
        }