no more windows???

This commit is contained in:
lewd-alt
2025-05-07 11:22:15 -07:00
parent 9d89d2cb6a
commit 433cb7475f
4 changed files with 24 additions and 21 deletions

View File

@@ -110,11 +110,11 @@ namespace _2DGAMELIB
public Med()
{
Point dpi = GetDpi();
dpiX = dpi.X;
dpiY = dpi.Y;
DpiX = 96.0 / dpiX;
DpiY = 96.0 / dpiY;
//Point dpi = GetDpi();
//dpiX = dpi.X;
//dpiY = dpi.Y;
DpiX = 1.0; // 96.0 / dpiX;
DpiY = 1.0; // 96.0 / dpiY;
}
public void FadeIn(double Rate)
@@ -440,26 +440,27 @@ namespace _2DGAMELIB
Sce.Dispose();
}
[DllImport("user32.dll")]
private static extern bool SetProcessDPIAware();
//[DllImport("user32.dll")]
//private static extern bool SetProcessDPIAware();
[DllImport("user32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hwnd);
//[DllImport("user32.dll")]
//private static extern IntPtr GetWindowDC(IntPtr hwnd);
[DllImport("gdi32.dll")]
private static extern int GetDeviceCaps(IntPtr hdc, int index);
//[DllImport("gdi32.dll")]
//private static extern int GetDeviceCaps(IntPtr hdc, int index);
[DllImport("user32.dll")]
private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
//[DllImport("user32.dll")]
//private static extern int ReleaseDC(IntPtr hwnd, IntPtr hdc);
/*
public static Point GetDpi()
{
SetProcessDPIAware();
IntPtr windowDC = GetWindowDC(IntPtr.Zero);
Point result = new Point(GetDeviceCaps(windowDC, 88), GetDeviceCaps(windowDC, 90));
ReleaseDC(IntPtr.Zero, windowDC);
return result;
}
//SetProcessDPIAware();
//IntPtr windowDC = GetWindowDC(IntPtr.Zero);
//Point result = new Point(GetDeviceCaps(windowDC, 88), GetDeviceCaps(windowDC, 90));
//ReleaseDC(IntPtr.Zero, windowDC);
//return result;
}*/
static Med()
{