用WMI调节显示器亮度,急,求高手

pisces007 2010-06-08 02:23:43
如何用WMI调节显示器亮度?
如果通过查找WmiSetBrightness函数,可以输入数字(比如50)来设置显示器的亮度值.
但是显示器一般有几个Level:
有的是30开始, 能调到100
有的是47开始, 能调到255.
如果得到这些Level的范围?
多谢!
...全文
508 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
t20100504t 2010-06-09
  • 打赏
  • 举报
回复
学习学习!
MoXiaoRab 2010-06-09
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 pisces007 的回复:]
谢谢楼上各位的回复,
但是客户要求必须用WMI.
所以请帮助我一下, 如何得到100或者255这些Level的值.多谢!
[/Quote]
很难,要和显卡驱动打交道。显卡种类这么多...

WMI里面不是什么都有的
pisces007 2010-06-09
  • 打赏
  • 举报
回复
up
.
pisces007 2010-06-09
  • 打赏
  • 举报
回复
所以我也很无奈啊
wangli820 2010-06-09
  • 打赏
  • 举报
回复
你的客户是干什么的啊,还非要用WMI,最重要的是达到目的,而不是用什么方法
pisces007 2010-06-08
  • 打赏
  • 举报
回复
谢谢楼上各位的回复,
但是客户要求必须用WMI.
所以请帮助我一下, 如何得到100或者255这些Level的值.多谢!
MoXiaoRab 2010-06-08
  • 打赏
  • 举报
回复


void * lpGamma = NULL;
WORD gMap[3][256] = {0};
lpGamma = &gMap;
HDC hdc = ::GetDC(NULL);
::GetDeviceGammaRamp(hdc, lpGamma); //得到当前Gamma
for (INT i = 0; i < 256; i++)
{
gMap[0][i] = 256*i;
gMap[1][i] = 256*i;
gMap[2][i] = 256*i;
}
::SetDeviceGammaRamp(hdc, lpGamma); //设为标准Gamma



试试这个
wangli820 2010-06-08
  • 打赏
  • 举报
回复
看看这个资源吧
http://download.csdn.net/source/2438941
完美实现调节亮度
pisces007 2010-06-08
  • 打赏
  • 举报
回复
啊?有很多种类型. 不能简单二分
soswaidao 2010-06-08
  • 打赏
  • 举报
回复
二分法
Gamma Manager is based on Gamma Slider control. This control allows to change gamma monitor on most graphic cards. The goal for this project is very simple and control is for VC6 & VC7. The other day I downloaded a N64 emulator but the screen was so black that I did not see anything. I had thus to find this solution to lighten my screen. I know that the tools of my video chart make it possible to change gamma of my screen, but it is faster with this tool. Implementation The implementation of this slider control is very easy. Import GammaSlider.h and GammaSlider.cpp into your project. Include reference to the class control. Add slider control on a form. Use ClassWizard to declare variable name derived from CGammaSlider control. That's it, enjoy! Under the hood Windows provides two APIs GetDeviceGammaRamp/ SetDeviceGammaRamp to perform gamma correction. In fact we need to have a 3 dimensional buffer of 256 WORD to manipulate gamma correction. To change gamma, it is necessary to change the RGB value of each color contained in the buffer by a float factor between 0.0 and 2.0. Example We need to save current gamma for future restore. Collapse Copy CodeWORD m_RampSaved[256*3]; if (!GetDeviceGammaRamp(::GetDC(NULL), m_RampSaved)) { TRACE("WARNING: Cannot initialize DeviceGammaRamp.\n"); }To change gamma, cycle into ramp buffer and change RGB color where Gamma is the float factor. Collapse Copy CodeWORD ramp[256*3]; for( int i=0; i<256; i++ ) { ramp[i+0] = ramp[i+256] = ramp[i+512] = (WORD)min(65535, max(0, pow((i+1) / 256.0, Gamma) * 65535 + 0.5)); } SetDeviceGammaRamp(::GetDC(NULL), ramp);Now to trap slider control message, we need to use a special message ON_WM_HSCROLL_REFLECT() that can provide message to be dispatched into control class itself.

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧