示例#1
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(prevOutputFormatCombox, 0);
            UIHelpers.FillEnumComboBox(prevOutputFormatCombox, typeof(Upscale.ExportFormats));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            await CheckInstallation();

            EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }
        }
示例#2
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists(Path.Combine(Paths.GetExeDir(), "runtimes")) && Paths.GetExeDir().ToLower().Contains("temp"))
            {
                MessageBox.Show("You seem to be running Flowframes out of an archive.\nPlease extract the whole archive first!", "Error");
                IOUtils.TryDeleteIfExists(Paths.GetDataPath());
                Application.Exit();
            }

            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(imageOutputFormat, 0);
            UIHelpers.FillEnumComboBox(imageOutputFormat, typeof(Upscale.ImgExportMode));
            UIHelpers.FillEnumComboBox(videoOutputFormat, typeof(Upscale.VidExportMode));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            UIHelpers.InitCombox(batchCacheSplitDepth, 0);
            // Video Upscale
            UIHelpers.InitCombox(videoPreprocessMode, 1);

            await CheckInstallation();

            await EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }

            LoadEsrganOptions();

            flowPanelLeft.AutoScroll = false;
            flowPanelLeft.HorizontalScroll.Maximum = 0;
            flowPanelLeft.VerticalScroll.Visible   = false;
            flowPanelLeft.AutoScroll = true;

            flowPanelRight.AutoScroll = false;
            flowPanelRight.HorizontalScroll.Maximum = 0;
            flowPanelRight.VerticalScroll.Visible   = false;
            flowPanelRight.AutoScroll = true;

            initialized = true;
            BusyCheckLoop();
        }
示例#3
0
        private async void MainForm_Load(object sender, EventArgs e)
        {
            // Left Panel
            UIHelpers.InitCombox(prevClipboardTypeCombox, 0);
            UIHelpers.InitCombox(preResizeScale, 1);
            UIHelpers.InitCombox(preResizeMode, 0);
            UIHelpers.FillEnumComboBox(preResizeFilter, typeof(Upscale.Filter), 0);
            // Right Panel
            UIHelpers.InitCombox(prevOverwriteCombox, 0);
            UIHelpers.InitCombox(imageOutputFormat, 0);
            UIHelpers.FillEnumComboBox(imageOutputFormat, typeof(Upscale.ImgExportMode));
            UIHelpers.FillEnumComboBox(videoOutputFormat, typeof(Upscale.VidExportMode));
            UIHelpers.InitCombox(postResizeScale, 1);
            UIHelpers.InitCombox(postResizeMode, 0);
            UIHelpers.FillEnumComboBox(postResizeFilter, typeof(Upscale.Filter), 0);
            // Batch Upscale
            UIHelpers.InitCombox(batchOutMode, 0);
            UIHelpers.InitCombox(preprocessMode, 0);
            UIHelpers.InitCombox(batchCacheSplitDepth, 0);
            // Video Upscale
            UIHelpers.InitCombox(videoPreprocessMode, 1);

            await CheckInstallation();

            await EmbeddedPython.Init();

            EsrganData.CheckModelDir();
            EsrganData.ReloadModelList();

            NvApi.Init();

            if (OSUtils.IsUserAdministrator())
            {
                Program.ShowMessage("Cupscale is running as administrator.\nThis will break Drag-n-Drop functionality.", "Warning");
            }

            LoadEsrganOptions();

            flowPanelLeft.AutoScroll = false;
            flowPanelLeft.HorizontalScroll.Maximum = 0;
            flowPanelLeft.VerticalScroll.Visible   = false;
            flowPanelLeft.AutoScroll = true;

            flowPanelRight.AutoScroll = false;
            flowPanelRight.HorizontalScroll.Maximum = 0;
            flowPanelRight.VerticalScroll.Visible   = false;
            flowPanelRight.AutoScroll = true;

            initialized = true;
            BusyCheckLoop();
        }
示例#4
0
        private async void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            await Task.Delay(100);

            SaveSettings();
            EmbeddedPython.Init();
            if (Config.GetInt("pythonRuntime") == 1 && !File.Exists(EmbeddedPython.GetEmbedPyPath()))
            {
                MsgBox msg = Program.ShowMessage("You enabled the embedded Python runtime but haven't downloaded and installed it.\n" +
                                                 "You can download it in the Dependency Checker window.");
                while (DialogQueue.IsOpen(msg))
                {
                    await Task.Delay(50);
                }

                new DependencyCheckerForm(true).ShowDialog();
            }
        }