Ejemplo n.º 1
0
        /// <summary>
        /// Returns an array of all video modes supported by the specified
        /// monitor. The returned array is sorted in ascending order, first by
        /// color bit depth (the sum of all channel depths) and then by
        /// resolution area (the product of width and height).
        /// </summary>
        /// <param name="monitor">
        /// The monitor to query.
        /// </param>
        /// <returns>
        /// An array of video modes, or Null if an error occurred.
        /// </returns>
        public static VideoMode[] GetVideoModes(MonitorHandle monitor)
        {
            VideoMode *videoModePointer = GetVideoModes(monitor, out int count);

            var result = new VideoMode[count];

            for (int i = 0; i < count; i++)
            {
                result[i] = videoModePointer[i];
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns an array of handles for all currently connected monitors.
        /// The primary monitor is always first in the returned array. If no
        /// monitors were found, this function returns Null.
        /// </summary>
        /// <returns>
        /// An array of monitor handles, or Null if no monitors were found or
        /// if an error occurred.
        /// </returns>
        public static MonitorHandle[] GetMonitors()
        {
            MonitorHandle *monitorPointer = GetMonitors(out int count);

            var result = new MonitorHandle[count];

            for (int i = 0; i < count; i++)
            {
                result[i] = monitorPointer[i];
            }

            return(result);
        }
Ejemplo n.º 3
0
 public static extern IntPtr CreateWindow(int width, int height, [MarshalAs(UnmanagedType.LPStr)] string title, MonitorHandle monitor, IntPtr share);
Ejemplo n.º 4
0
 public static extern void SetGamma(MonitorHandle monitor, float gamma);
Ejemplo n.º 5
0
 public static extern VideoModePointer GetVideoMode(MonitorHandle monitor);
Ejemplo n.º 6
0
 public static extern VideoMode *GetVideoModes(MonitorHandle monitor, out int count);
Ejemplo n.º 7
0
 public static extern NativeString GetMonitorName(MonitorHandle monitor);
Ejemplo n.º 8
0
 public static extern void GetMonitorPhysicalSize(MonitorHandle monitor, out int widthMm, out int heightMm);
Ejemplo n.º 9
0
 public static extern void GetMonitorPos(MonitorHandle monitor, out int xPos, out int yPos);