Esempio n. 1
0
        public static void SetGammaRed(int gamma)
        {
            if (gamma <= 256 && gamma >= 1)
            {
                RAMPRED ramp = new RAMPRED();
                ramp.Red = new ushort[256];

                for (int i = 1; i < 256; i++)
                {
                    int iArrayValue = i * (gamma + 128);

                    if (iArrayValue > 65535)
                    {
                        iArrayValue = 65535;
                    }
                    ramp.Red[i] = (ushort)iArrayValue;
                }
                SetDeviceGammaRampRED(GetDC(IntPtr.Zero), ref ramp);
            }
        }
Esempio n. 2
0
 public static extern bool SetDeviceGammaRampRED(IntPtr hDC, ref RAMPRED lpRamp);