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

@@ -5,12 +5,13 @@
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseWindowsForms>True</UseWindowsForms>
<TargetFramework>netstandard2.1</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<PropertyGroup>
<LangVersion>9.0</LangVersion>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<GenerateResourceUsePreserializedResources>true</GenerateResourceUsePreserializedResources>
</PropertyGroup>
<PropertyGroup>
<RootNamespace />
@@ -22,5 +23,6 @@
<PackageReference Include="OpenGL.Net" Version="0.8.4" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.3" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.1" />
</ItemGroup>
</Project>

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()
{

View File

@@ -5,7 +5,7 @@
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<LangVersion>9.0</LangVersion>

Binary file not shown.