Use effective pixels for unsupported previewer (#26345)

This commit is contained in:
Samuel Chapleau
2023-05-26 12:46:43 -07:00
committed by GitHub
parent 6d676329ce
commit 95a9a8a2b0
12 changed files with 72 additions and 41 deletions

View File

@@ -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;
}
}
}