Fork me on GitHub

WPF获取系统dpi

WPF获取系统dpi

var dpiX = (int)typeof(SystemParameters).GetProperty("DpiX", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null);
var dpiY = (int)typeof(SystemParameters).GetProperty("Dpi", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null, null);

来源:https://stackoverflow.com/a/12487917/7068790

posted @ 2022-09-25 13:56  猫叔Vincent  阅读(147)  评论(0编辑  收藏  举报