G
Guest
Hi Community
Can anyone help with GetContrast and SetContrast.
I have made something in vb.
<Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function CreateDC(ByVal lpszDriver As String, ByVal
lpszDevice As String, _
ByVal lpszOutput As String, ByRef deviceMode As IntPtr) As IntPtr
End Function
Declare Function ExtEscape Lib "coredll" Alias "ExtEscape" (ByVal
hdc As IntPtr, _
ByVal nEscape As Int32, _
ByVal cbInput As Int32, _
ByVal plszInData As Integer(), _
ByVal cbOutput As Int32, _
ByVal lpszOutData As IntPtr) As Int32
Const CONTRASTCOMMAND As Integer = 6149
Const CONTRAST_CMD_GET As Integer = 0
<Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function ReleaseDC(ByVal Hwnd As IntPtr, _
ByVal hdc As IntPtr) As Integer
End Function
Public Property Kontrast() As Long
Get
Dim vpm(1) As Integer
vpm(0) = CONTRAST_CMD_GET
vpm(1) = 0
Dim Wert As Integer = 10
Dim hdc As Integer
hdc = CreateDC("ddi.dll", 0, 0, 0)
Wert = ExtEscape(hdc, CONTRASTCOMMAND, 8, vpm,
Integer.MaxValue, Wert)
ReleaseDC(0, hdc)
Return Wert
End Get
Set(ByVal value As Long)
End Set
End Property
But it always return 0 what shuld I do , have anyone an example in vb
or c#
Thanks Tim
Can anyone help with GetContrast and SetContrast.
I have made something in vb.
<Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function CreateDC(ByVal lpszDriver As String, ByVal
lpszDevice As String, _
ByVal lpszOutput As String, ByRef deviceMode As IntPtr) As IntPtr
End Function
Declare Function ExtEscape Lib "coredll" Alias "ExtEscape" (ByVal
hdc As IntPtr, _
ByVal nEscape As Int32, _
ByVal cbInput As Int32, _
ByVal plszInData As Integer(), _
ByVal cbOutput As Int32, _
ByVal lpszOutData As IntPtr) As Int32
Const CONTRASTCOMMAND As Integer = 6149
Const CONTRAST_CMD_GET As Integer = 0
<Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function ReleaseDC(ByVal Hwnd As IntPtr, _
ByVal hdc As IntPtr) As Integer
End Function
Public Property Kontrast() As Long
Get
Dim vpm(1) As Integer
vpm(0) = CONTRAST_CMD_GET
vpm(1) = 0
Dim Wert As Integer = 10
Dim hdc As Integer
hdc = CreateDC("ddi.dll", 0, 0, 0)
Wert = ExtEscape(hdc, CONTRASTCOMMAND, 8, vpm,
Integer.MaxValue, Wert)
ReleaseDC(0, hdc)
Return Wert
End Get
Set(ByVal value As Long)
End Set
End Property
But it always return 0 what shuld I do , have anyone an example in vb
or c#
Thanks Tim