Skip to content

Instantly share code, notes, and snippets.

@kumatti1
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumatti1/30c8de794113baae37d4 to your computer and use it in GitHub Desktop.
Save kumatti1/30c8de794113baae37d4 to your computer and use it in GitHub Desktop.
色調整したいねん(・∀・)

・モニタ側の調整でなくてチップセット/iGPU側の色調整

EnumDisplayDevicesで得られるデバイスIDとは別個のもので識別値が割り当てられてる (引数名がdeviceiIDなので紛らわしいが)

ColorInfoクラスのGetColorメソッドはラッパーなので その先のFriendスコープのクラスのメソッドの引数が全てクラスなのでNewでインスタンス化しておかなくてはいけない。 ColorFeatureクラスのColorFeatureプロパティは配列を返すが、それぞれRGBの意である。

設定のSetColorメソッドもラッパーである。 その先の先のFriendスコープのクラスでドライバに対して設定が行われる。

それで事前にGetColorを呼び出しおかなくてはいけない。 サンプルの設定コードは Contrast だけを設定しているのではなくて、 BrightnessやGammaなども同時に設定されているからだ。

Imports ServiceLibrary
'gfxSrvc.dll
Module Module1
Sub Main()
Dim objPenent As New CEDID
For i As UShort = 0 To 32
Dim objChild As New CEDID.CEDID_V1_Block
Dim tmp As uint32 = 1
Dim DevID As UInteger = tmp << i
objChild.DsiplayDev.U32DeviceID = DevID
If objPenent.GetEDIDBlock(objChild) Then
settings(objChild.DsiplayDev.U32DeviceID)
End If
Next
End Sub
Private Sub settings(ByVal deviceID As UInteger)
Dim oColor As New ColorInfo
With oColor
.Gamma = New ColorFeature
.Brightness = New ColorFeature
.Contrast = New ColorFeature
.Hue = New ColorFeature
.Saturation = New ColorFeature
.gamutExpansion = New GamutExpansion
.device = New CDevice
.device.U32DeviceID = deviceID
.GetColor()
Dim arr(3) As Integer
arr = .Contrast.I32CurrentValues
For j = LBound(arr) To UBound(arr)
Console.WriteLine(arr(j))
Next
MsgBox("")
End With
End Sub
End Module
Imports ServiceLibrary
'gfxSrvc.dll
Module Module1
Sub Main()
Dim objPenent As New CEDID
For i As UShort = 0 To 32
Dim objChild As New CEDID.CEDID_V1_Block
Dim tmp As uint32 = 1
Dim DevID As UInteger = tmp << i
objChild.DsiplayDev.U32DeviceID = DevID
If objPenent.GetEDIDBlock(objChild) Then
settings(objChild.DsiplayDev.U32DeviceID)
End If
Next
End Sub
Private Sub settings(ByVal deviceID As UInteger)
Dim oColor As New ColorInfo
With oColor
.Gamma = New ColorFeature
.Brightness = New ColorFeature
.Contrast = New ColorFeature
.Hue = New ColorFeature
.Saturation = New ColorFeature
.gamutExpansion = New GamutExpansion
.device = New CDevice
.device.U32DeviceID = deviceID
.GetColor()
Dim arr(3) As Integer
arr = .Contrast.I32CurrentValues
For j = LBound(arr) To UBound(arr)
arr(j) = 49
Next
.Contrast.I32CurrentValues = arr
.SetColor()
MsgBox("")
End With
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment