Example #1
0
        private static float GetDpi(GetDeviceCapsIndex index)
        {
            IntPtr desktopWnd = IntPtr.Zero;
            IntPtr dc         = GetDC(desktopWnd);
            float  dpi;

            try
            {
                dpi = GetDeviceCaps(dc, (int)index);
            }
            finally
            {
                ReleaseDC(desktopWnd, dc);
            }
            return(dpi / 96f);
        }
Example #2
0
File: API.cs Project: 3guy/testRe
		public static extern int GetDeviceCaps(IntPtr hdc, GetDeviceCapsIndex nIndex); 
 public static extern int GetDeviceCaps([In] IntPtr hdc, [In] GetDeviceCapsIndex capIndex);