コード例 #1
0
        public VibranceProxy(bool isSilenced = false)
        {
            try
            {
                vibranceInfo = new VIBRANCE_INFO();
                bool  ret        = initializeLibrary();
                int[] gpuHandles = new int[NVAPI_MAX_PHYSICAL_GPUS];
                enumeratePhsyicalGPUs(gpuHandles);
                vibranceInfo.activeOutput = getActiveOutputs(gpuHandles);

                StringBuilder buffer = new StringBuilder(64);
                char[]        sz     = new char[64];
                getGpuName(gpuHandles, buffer);
                vibranceInfo.szGpuName     = buffer.ToString();
                vibranceInfo.defaultHandle = enumerateNvidiaDisplayHandle();

                NV_DISPLAY_DVC_INFO info = new NV_DISPLAY_DVC_INFO();
                if (getDVCInfo(ref info, vibranceInfo.defaultHandle))
                {
                    if (info.currentLevel != vibranceInfo.userVibranceSettingDefault)
                    {
                        setDVCLevel(vibranceInfo.defaultHandle, vibranceInfo.userVibranceSettingDefault);
                    }
                }

                vibranceInfo.isInitialized = true;
            }
            catch (Exception)
            {
                MessageBox.Show(VibranceProxy.NVAPI_ERROR_INIT_FAILED);
            }
        }
コード例 #2
0
 static extern bool getDVCInfo(ref NV_DISPLAY_DVC_INFO info, int defaultHandle);
コード例 #3
0
        public NvidiaVibranceProxy(bool isSilenced = false)
        {
            try
            {
                vibranceInfo = new VIBRANCE_INFO();
                bool ret = initializeLibrary();

                int[] gpuHandles = new int[NVAPI_MAX_PHYSICAL_GPUS];
                int[] outputIds = new int[NVAPI_MAX_PHYSICAL_GPUS];
                enumeratePhsyicalGPUs(gpuHandles);

                enumerateDisplayHandles();
               
                vibranceInfo.activeOutput = getActiveOutputs(gpuHandles, outputIds);
                StringBuilder buffer = new StringBuilder(64);
                char[] sz = new char[64];
                getGpuName(gpuHandles, buffer);
                vibranceInfo.szGpuName = buffer.ToString();
                vibranceInfo.defaultHandle = enumerateNvidiaDisplayHandle(0);

                NV_DISPLAY_DVC_INFO info = new NV_DISPLAY_DVC_INFO();
                if (getDVCInfo(ref info, vibranceInfo.defaultHandle))
                {
                    if (info.currentLevel != vibranceInfo.userVibranceSettingDefault)
                    {
                        setDVCLevel(vibranceInfo.defaultHandle, vibranceInfo.userVibranceSettingDefault);
                    }
                }

                vibranceInfo.isInitialized = true;
            }
            catch (Exception)
            {
                MessageBox.Show(NvidiaVibranceProxy.NVAPI_ERROR_INIT_FAILED);
            }

        }
コード例 #4
0
 static extern bool getDVCInfo(ref NV_DISPLAY_DVC_INFO info, int defaultHandle);