【问题标题】:Change screen color balance programmatically以编程方式更改屏幕色彩平衡
【发布时间】:2014-02-01 08:07:03
【问题描述】:

在 GDI32.DLL 中改变 Windows 色彩平衡的函数名称是什么?

例如,要更改设备伽玛,我需要使用 SetDeviceGammaRamp

[DllImport("GDI32.dll")]
private unsafe static extern bool SetDeviceGammaRamp(Int32 hdc, void* ramp);

【问题讨论】:

  • 色彩平衡是指亮度和修改 RGB 值,对吧?
  • 正确(红色、绿色和蓝色),您可以在 dccw.exe 的“调整色彩平衡”中修改相同的值
  • WcsAssociateColorProfileWithDevice()

标签: c# c++ vb.net windows gdi


【解决方案1】:

您可以调整屏幕的 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);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-31
    • 2012-05-31
    • 1970-01-01
    • 1970-01-01
    • 2014-11-26
    • 2013-08-18
    相关资源
    最近更新 更多