static Dpi GetDpiFromGetDpiForMonitor(IntPtr hMonitor, Win32.MonitorDpiType dpiType) { try { var ret = new Dpi(); uint dpiX = 0, dpiY = 0; Win32.NativeMethods.GetDpiForMonitor(hMonitor, dpiType, ref dpiX, ref dpiY); ret.X = dpiX; ret.Y = dpiY; return(ret); } catch (Exception ex) { #if DEBUG Debugger.Break(); #endif Debug.WriteLine(ex.Message); return(Dpi.Default); } }
public bool Equals(Dpi other) { return(X == other.X && Y == other.Y); }