1 [DllImport("dxva2.dll")]
2 public static extern bool GetNumberOfPhysicalMonitorsFromHMONITOR(IntPtr hMonitor, ref uint pdwNumberOfPhysicalMonitors);
4 [DllImport("dxva2.dll")]
5 public static extern bool GetPhysicalMonitorsFromHMONITOR(IntPtr hMonitor,
6 uint dwPhysicalMonitorArraySize, [Out] PhysicalMonitor[] pPhysicalMonitorArray);
8 [DllImport("dxva2.dll")]
9 public static extern bool DestroyPhysicalMonitors(uint dwPhysicalMonitorArraySize,
10 [Out] PhysicalMonitor[] pPhysicalMonitorArray);
12 [DllImport("dxva2.dll")]
13 public static extern bool GetMonitorTechnologyType(IntPtr hMonitor,
14 ref McDisplayTechnologyType pdtyDisplayTechnologyType);
16 [DllImport("dxva2.dll")]
17 public static extern bool GetMonitorCapabilities(IntPtr hMonitor, ref uint pdwMonitorCapabilities,
18 ref uint pdwSupportedColorTemperatures);
20 [DllImport("dxva2.dll")]
21 public static extern bool SetMonitorBrightness(IntPtr hMonitor, short brightness);
23 [DllImport("dxva2.dll")]
24 public static extern bool SetMonitorContrast(IntPtr hMonitor, short contrast);
26 [DllImport("dxva2.dll")]
27 public static extern bool GetMonitorBrightness(IntPtr hMonitor, ref short pdwMinimumBrightness,
28 ref short pdwCurrentBrightness, ref short pdwMaximumBrightness);
30 [DllImport("dxva2.dll")]
31 public static extern bool GetMonitorContrast(IntPtr hMonitor, ref short pwdMinimumContrast,
32 ref short pwdCurrentContrast, ref short pwdMaximumContrast);
DataHandlerClass _cls = new DataHandlerClass();
_CUI_COLOR_DEVICES _screenModel = default(_CUI_COLOR_DEVICES);
public AjustScreenByIgfxDHLib()
CUI_SUPPORTED_CONFIG cui_SUPPORTED_CONFIG = default(CUI_SUPPORTED_CONFIG);
uint num = _cls.get_SupportedConfig(ref cui_SUPPORTED_CONFIG);
var id = cui_SUPPORTED_CONFIG.DeviceConfig[0].DispDev[0];
uint[] array = new uint[3];
var a = _cls.get_GetDeviceList(id, array);
_screenModel.ulDevices = array[0];
_screenModel.Device = new _CUI_COLOR_INFO[3];
_screenModel.Device[0].Brightness.color = _COLOR_TYPE.NumColors;
_screenModel.Device[0].Contrast.color = _COLOR_TYPE.NumColors;
_screenModel.Device[0].Gamma.color = _COLOR_TYPE.NumColors;
_screenModel.Command = _CUI_COLOR_COMMAND.GET_COLOR;
_cls.get_color(_screenModel.ulDevices, ref _screenModel);
注意事项
该方法使用时请注意好参数的范围,比如说把对比度设置太低时屏幕会完全黑掉 什么都看不到,然后你就不能直接把对比度调回来了.