예제 #1
0
        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);
            }
        }
예제 #2
0
 public bool Equals(Dpi other)
 {
     return(X == other.X && Y == other.Y);
 }