コード例 #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
 public static void FillModelComboBox(ComboBox box, bool resetIndex = false)
 {
     EsrganData.ReloadModelList();
     box.Items.Clear();
     foreach (string model in EsrganData.models)
     {
         box.Items.Add(model);
     }
     if (resetIndex || string.IsNullOrEmpty(box.Text))
     {
         InitCombox(box, 0);
     }
 }
コード例 #3
0
 private void refreshModelsBtn_Click(object sender, EventArgs e)
 {
     EsrganData.ReloadModelList();
 }