コード例 #1
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();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: MicRaving/cupscale
        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();
        }