private void CmbResolution_TextChanged(object sender, EventArgs e) { if (ResolutionScaler.ReadResolutionString(cmbResolution.Text, picScreen.Width, picScreen.Height)) { UpdateResolution(); } }
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; } }
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; }
private void PicOverlay_MouseMove(object sender, MouseEventArgs e) { if (!dragging) { return; } Point client = picScreen.PointToClient(Cursor.Position); client.X -= picOverlay.Width / 2; client.Y -= picOverlay.Height / 2; UpdatePosition(client); Point point = ResolutionScaler.SetResolutionValues(new Point(picOverlay.Left, picOverlay.Top)); nudPosX.Value = point.X; nudPosY.Value = point.Y; }