设置色温

#SingleInstance,force
#Persistent
;SetFormat,float,0.0
VarSetCapacity(OriginalRamp,512*3,0)
hr:=DllCall("GetDeviceGammaRamp","uint",DllCall("GetDC","ptr",0,"uint"),"ptr",&OriginalRamp)

red:=NumGet(OriginalRamp,512-2,"ushort")/0xFF00
green:=NumGet(OriginalRamp,512*2-2,"ushort")/0xFF00
blue:=NumGet(OriginalRamp,512*3-2,"ushort")/0xFF00

gui,add,text,x0 y0 w30 h20,red
gui,add,text,x0 y25 w30 h20,green
gui,add,text,x0 y50 w30 h20,blue
SetFormat,float,0.0
gui,add,edit,x35 y0 w45 h20 vred
gui,add,updown,Range1-100,% red*100
gui,add,edit,x35 y25 w45 h20 vgreen
gui,add,updown,Range1-100,% green*100
gui,add,edit,x35 y50 w45 h20 vblue
gui,add,updown,Range1-100,% blue*100
SetFormat,float,0.2
gui,add,text,x80 y0 w30 h20,`%
gui,add,text,x80 y25 w30 h20,`%
gui,add,text,x80 y50 w30 h20,`%

gui,add,button,x0 y75 w100 h20 gSetCT,Set
gui,add,button,x0 y100 w100 h20 gResetCT,Reset
gui,show,w100 h120
return

SetCT:
	gui,submit,nohide
	SetColorTemperature(normal(red/100),normal(green/100),normal(blue/100))
	return
	
ResetCT:
	DllCall("SetDeviceGammaRamp","uint",DllCall("GetDC","ptr",0,"uint"),"ptr",&OriginalRamp)
	return

normal(c){
	return c1?1:c
}

SetColorTemperature(r,g,b)
{
	rgb:=[],rgb.1:=r,rgb.2:=g,rgb.3:=b
	VarSetCapacity(ramp,512*3,0)
	loop 3 {
		i:=A_Index
		loop 256 
			NumPut(floor((A_Index-1)*rgb[i]*256),ramp,(i-1)*512+(A_Index-1)*2,"ushort")
	}
	return DllCall("SetDeviceGammaRamp","uint",DllCall("GetDC","ptr",0,"uint"),"ptr",&ramp)
}
return

GuiClose:
ExitApp

给TA捐赠
共{{data.count}}人
人已捐赠
其他

记事本绝佳用法

2020-3-9 5:33:44

其他

试题随机组合

2020-3-9 5:35:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索