mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Use effective pixels for unsupported previewer (#26345)
This commit is contained in:
@@ -58,5 +58,12 @@ namespace Peek.UI.Extensions
|
||||
PInvoke.GetMonitorInfo(monitor, ref info);
|
||||
return new Size(info.rcMonitor.Size.Width, info.rcMonitor.Size.Height);
|
||||
}
|
||||
|
||||
internal static double GetMonitorScale(this HWND hwnd)
|
||||
{
|
||||
var dpi = PInvoke.GetDpiForWindow(hwnd);
|
||||
var scalingFactor = dpi / 96d;
|
||||
return scalingFactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user