GDI32.DLL中用于更改Windows上颜色平衡的函数的名称是什么?
例如要更改设备伽马我需要使用SetDeviceGammaRamp
[DllImport("GDI32.dll")] private unsafe static extern bool SetDeviceGammaRamp(Int32 hdc, void* ramp);
提前致谢。
您可以调整屏幕的RGB值,并使用与您所提到的功能完全相同的功能更改其亮度: SetDeviceGammaRamp
看到这里: http : //www.nirsoft.net/vc/change_screen_brightness.html
函数的第二个参数,你传递的是RGB值:
//Generate the 256-colors array for the specified wBrightness value. WORD GammaArray[3][256]; for (int iIndex = 0; iIndex < 256; iIndex++) { int iArrayValue = iIndex * (wBrightness + 128); if (iArrayValue > 65535) iArrayValue = 65535; GammaArray[0][iIndex] = GammaArray[1][iIndex] = GammaArray[2][iIndex] = (WORD)iArrayValue; } //Set the GammaArray values into the display device context. bReturn = SetDeviceGammaRamp(hGammaDC, GammaArray);