Fix multi monitor setup with different DPI values
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
|
|
||||||
- Fix keyboard layout change not working.
|
- Fix keyboard layout change not working.
|
||||||
|
- Fix multi monitor setup with different DPI values.
|
||||||
|
|
||||||
|
|
||||||
5.8.0.0 Beta (2022-04-02)
|
5.8.0.0 Beta (2022-04-02)
|
||||||
|
|
||||||
|
|||||||
@@ -1315,41 +1315,34 @@ KP1 script-binding delete_current_file/confirm
|
|||||||
|
|
||||||
public void ShowLogo()
|
public void ShowLogo()
|
||||||
{
|
{
|
||||||
if (!App.ShowLogo || (MainForm.Instance == null || App.Settings.LogoCrash))
|
if (!App.ShowLogo || MainForm.Instance == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
bool december = DateTime.Now.Month == 12;
|
||||||
|
|
||||||
|
Rectangle cr = MainForm.Instance.ClientRectangle;
|
||||||
|
int len = Convert.ToInt32(cr.Height / (december ? 4.5 : 5));
|
||||||
|
|
||||||
|
if (len < 16 || cr.Height < 16)
|
||||||
|
return;
|
||||||
|
|
||||||
|
using (Bitmap bmp = new Bitmap(len, len))
|
||||||
{
|
{
|
||||||
bool december = DateTime.Now.Month == 12;
|
using (Graphics gx = Graphics.FromImage(bmp))
|
||||||
|
|
||||||
Rectangle cr = MainForm.Instance.ClientRectangle;
|
|
||||||
int len = Convert.ToInt32(cr.Height / (december ? 4.5 : 5));
|
|
||||||
|
|
||||||
if (len == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
using (Bitmap bmp = new Bitmap(len, len))
|
|
||||||
{
|
{
|
||||||
using (Graphics gx = Graphics.FromImage(bmp))
|
gx.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||||
{
|
gx.Clear(Color.Black);
|
||||||
gx.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
Rectangle rect = new Rectangle(0, 0, len, len);
|
||||||
gx.Clear(Color.Black);
|
Bitmap bmp2 = december ? Properties.Resources.mpvnet_santa : Properties.Resources.mpvnet;
|
||||||
Rectangle rect = new Rectangle(0, 0, len, len);
|
gx.DrawImage(bmp2, rect);
|
||||||
Bitmap bmp2 = december ? Properties.Resources.mpvnet_santa : Properties.Resources.mpvnet;
|
BitmapData bd = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppPArgb);
|
||||||
gx.DrawImage(bmp2, rect);
|
int x = Convert.ToInt32((cr.Width - len) / (december ? 1.95 : 2));
|
||||||
BitmapData bd = bmp.LockBits(rect, ImageLockMode.ReadOnly, PixelFormat.Format32bppPArgb);
|
int y = Convert.ToInt32((cr.Height - len) / 2.0 * (december ? 0.85 : 0.9));
|
||||||
int x = Convert.ToInt32((cr.Width - len) / (december ? 1.95 : 2));
|
CommandV("overlay-add", "0", $"{x}", $"{y}", "&" + bd.Scan0.ToInt64().ToString(), "0", "bgra", bd.Width.ToString(), bd.Height.ToString(), bd.Stride.ToString());
|
||||||
int y = Convert.ToInt32((cr.Height - len) / 2.0 * (december ? 0.85 : 0.9));
|
bmp.UnlockBits(bd);
|
||||||
CommandV("overlay-add", "0", $"{x}", $"{y}", "&" + bd.Scan0.ToInt64().ToString(), "0", "bgra", bd.Width.ToString(), bd.Height.ToString(), bd.Stride.ToString());
|
IsLogoVisible = true;
|
||||||
bmp.UnlockBits(bd);
|
|
||||||
IsLogoVisible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
App.Settings.LogoCrash = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetLanguage(string id)
|
string GetLanguage(string id)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ namespace mpvnet
|
|||||||
public class AppSettings
|
public class AppSettings
|
||||||
{
|
{
|
||||||
public bool InputDefaultBindingsFixApplied;
|
public bool InputDefaultBindingsFixApplied;
|
||||||
public bool LogoCrash;
|
|
||||||
public bool ShowMenuFixApplied;
|
public bool ShowMenuFixApplied;
|
||||||
public int Volume = 70;
|
public int Volume = 70;
|
||||||
public List<string> RecentFiles = new List<string>();
|
public List<string> RecentFiles = new List<string>();
|
||||||
|
|||||||
Reference in New Issue
Block a user