Exemple #1
0
        public static int GetDeviceCaps(DeviceCap cap)
        {
            using (var g = Graphics.FromHwnd(IntPtr.Zero))
            {
                //Console.WriteLine("Graphics.DpiX: " + g.DpiX);
                //Console.WriteLine("Graphics.DpiY: " + g.DpiY);
                //Console.WriteLine();

                //var hdc = new HandleRef(g, g.GetHdc());
                IntPtr hdc    = g.GetHdc();
                int    result = GetDeviceCaps(hdc, (int)cap);
                g.ReleaseHdc();
                return(result);
            }
        }
Exemple #2
0
 internal static extern int GetDeviceCaps(IntPtr hdc, DeviceCap capindex);
Exemple #3
0
 private static extern int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex);
Exemple #4
0
 public static extern int GetDeviceCaps(HandleRef hdc, DeviceCap capability);
Exemple #5
0
 public static extern int GetDeviceCaps(
     User32.SafeDCHandle hdc,
     DeviceCap nIndex);
Exemple #6
0
 public static extern int GetDeviceCaps(IntPtr hdc, DeviceCap deviceCap);
Exemple #7
0
 public static extern Int32 GetDeviceCaps(IntPtr hDC, DeviceCap cap);
 public static extern int GetDeviceCaps(SafeDC hdc, DeviceCap nIndex);
 public static extern int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex);
 private static extern int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex);
 internal static extern int GetDeviceCaps(IntPtr hDc, DeviceCap nIndex);
Exemple #12
0
 public static extern Int32 GetDeviceCaps(IntPtr hdc, DeviceCap capindex);
 internal static extern int GetDeviceCaps(IntPtr hdc, DeviceCap capindex);
Exemple #14
0
 public static extern int GetDeviceCaps(
     HandleRef hdc,
     [MarshalAs(UnmanagedType.I4)] DeviceCap nIndex
     );
Exemple #15
0
 public static extern int GetDeviceCaps(IntPtr hdc, DeviceCap nIndex);
Exemple #16
0
 public static extern int GetDeviceCaps(HDC hdc, DeviceCap index);
Exemple #17
0
 public static extern int GetDeviceCaps(SafeDC hdc, DeviceCap nIndex);
Exemple #18
0
 public static extern int GetDeviceCaps(
     User32.SafeDCHandle hdc,
     DeviceCap nIndex);
Exemple #19
0
 internal static extern int GetDeviceCaps(IntPtr hDC, DeviceCap cap);