コード例 #1
0
        /// <summary>
        /// Changes screen color from a Config
        /// </summary>
        public unsafe void ChangeScreenColorFromConfig(Config config)
        {
            ushort *gArray = stackalloc ushort[3 * 256];

            foreach (Monitor monitor in _monitorService.GetMonitors())
            {
                ChangeScreenColorFromKelvin(6600, monitor);
            }

            foreach (Monitor monitor in config.Monitors)
            {
                for (int i = 0; i < 256 * 3; i++)
                {
                    gArray[i] = monitor.Rgb[i];
                }

                SetDeviceGammaRamp(_monitorService.GetHdcByMonitorIndex(monitor.Index).ToInt32(), gArray);
            }
        }