Ejemplo n.º 1
0
 private void CmbResolution_TextChanged(object sender, EventArgs e)
 {
     if (ResolutionScaler.ReadResolutionString(cmbResolution.Text, picScreen.Width, picScreen.Height))
     {
         UpdateResolution();
     }
 }
Ejemplo n.º 2
0
        private void IniRead()
        {
            string resolution = ini.IniReadValue("General", "Resolution");

            if (!ResolutionScaler.ReadResolutionString(resolution, picScreen.Width, picScreen.Height))
            {
                cmbResolution.SelectedIndex = 7;
            }
            else
            {
                cmbResolution.Text = resolution;
            }
            if (decimal.TryParse(ini.IniReadValue("General", "Scale"), out decimal scale))
            {
                nudScale.Value = scale;
            }
            else
            {
                nudScale.Value = 1.5M;
            }
            if (decimal.TryParse(ini.IniReadValue("General", "XPosition"), out decimal x))
            {
                nudPosX.Value = x;
            }
            else
            {
                nudPosX.Value = 1470;
            }
            if (decimal.TryParse(ini.IniReadValue("General", "YPosition"), out decimal y))
            {
                nudPosY.Value = y;
            }
            else
            {
                nudPosY.Value = 686;
            }
            if (bool.TryParse(ini.IniReadValue("General", "AlwaysShow"), out bool alwaysShow))
            {
                cbAlwaysShow.Checked = alwaysShow;
            }
            else
            {
                cbAlwaysShow.Checked = false;
            }
            theme = ini.IniReadValue("General", "Theme");
            if (string.IsNullOrEmpty(cbTheme.Text) || !Directory.Exists(baseDirectory + "\\Themes\\" + cbTheme.Text))
            {
                theme = "Xenn";
            }
            cbTheme.Text = theme;
            if (byte.TryParse(ini.IniReadValue("General", "Opacity"), out byte opacity))
            {
                tbOpacity.Value = opacity;
            }
            else
            {
                tbOpacity.Value = 255;
            }
        }
Ejemplo n.º 3
0
 private void UpdateResolution()
 {
     ResolutionScaler.ReadResolutionString(cmbResolution.Text, picScreen.Width, picScreen.Height);
     picScreen.Height = (int)Math.Ceiling(picScreen.Width / ResolutionScaler.AspectRatio);
     ResolutionScaler.ReadResolutionString(cmbResolution.Text, picScreen.Width, picScreen.Height);
     NudScale_ValueChanged(null, null);
     Height = picScreen.Bottom + txtDebugLog.Height + 50;
 }