更新整理

This commit is contained in:
GG Z
2025-04-24 20:56:44 +08:00
parent 155cef46f8
commit 5b6d67b571
813 changed files with 14437 additions and 12362 deletions

View File

@@ -1,7 +1,4 @@
namespace WPFluent.Hardware;
namespace WPFluent.Hardware;
/// <summary>
/// Stores DPI information from which a <see cref="System.Windows.Media.Visual"/> or <see

View File

@@ -31,7 +31,7 @@ internal static class DpiHelper
nint hdc = User32.GetDC(0);
float scaleX = Gdi32.GetDeviceCaps(hdc, Gdi32.DeviceCap.LOGPIXELSX);
float scaleY = Gdi32.GetDeviceCaps(hdc, Gdi32.DeviceCap.LOGPIXELSY);
_ = User32.ReleaseDC(IntPtr.Zero, hdc);
User32.ReleaseDC(IntPtr.Zero, hdc);
return new(scaleX / 96f, scaleY / 96f);
}
@@ -137,7 +137,7 @@ internal static class DpiHelper
/// <param name="windowHandle">Handle of the window that you want to get information about.</param>
public static DisplayDpi GetWindowDpi(IntPtr windowHandle)
{
if (windowHandle == IntPtr.Zero || !UnsafeNativeMethods.IsValidWindow(windowHandle))
if (windowHandle == IntPtr.Zero/* || !UnsafeNativeMethods.IsValidWindow(windowHandle)*/)
{
return new DisplayDpi(DefaultDpi, DefaultDpi);
}