vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Zippen wie die Profis!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2024
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB & Windows API
Re: SetDeviceGammaRamp funktioniert nicht 
Autor: ModeratorMartoeng (Moderator)
Datum: 14.06.11 20:30

Also bei mir funktioniert der verlinkte (und in VB konvertierte) Code ganz gut:

Function SetBrightness(ByVal wBrightness As Long) As Long
' /*
' Changes the brightness of the entire screen.
' This function may not work properly in some video cards.
'
' The wBrightness value should be a number between 0 and 255.
' 128 = Regular brightness
' above 128 = brighter
' below 128 = darker
'
'    If hDC is NULL, SetBrightness automatically load and release
'    the display device context for you.
'
' */
    Dim bReturn As Long, nIndex As Long
    Dim wValue As Long
    bReturn = 0
 
'      //Generate the 256-colors array for the specified wBrightness value.
   Dim GammaArray(0 To 255, 0 To 2) As Integer
 
   For nIndex = 0 To 255
       wValue = Min(nIndex * (wBrightness + 128), 65535)
       GammaArray(nIndex, 0) = Lng2Int(wValue)
       GammaArray(nIndex, 1) = Lng2Int(wValue)
       GammaArray(nIndex, 2) = Lng2Int(wValue)
       List2.AddItem nIndex & ": " & wValue 'GammaArray(nIndex, 0)
   Next
 
'      //Set the GammaArray values into the display device context.
   bReturn = SetDeviceGammaRamp(Me.hDC, GammaArray(0, 0))
 
 
 
    SetBrightness = bReturn
End Function
 
Function Min(ByVal val1 As Long, ByVal val2 As Long) As Long
    If val1 > val2 Then
        Min = val2
    Else
        Min = val1
    End If
End Function


vbarchiv.dll (Freeware), Tutorials uvm. auf http://www.martoeng.com.
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
SetDeviceGammaRamp funktioniert nicht4.821dbmaxpayne14.06.11 12:48
Re: SetDeviceGammaRamp funktioniert nicht3.411ModeratorMartoeng14.06.11 12:52
Re: SetDeviceGammaRamp funktioniert nicht3.408dbmaxpayne14.06.11 13:02
Re: SetDeviceGammaRamp funktioniert nicht3.411ModeratorMartoeng14.06.11 14:20
Re: SetDeviceGammaRamp funktioniert nicht3.389dbmaxpayne14.06.11 15:15
Re: SetDeviceGammaRamp funktioniert nicht3.265ModeratorMartoeng14.06.11 15:56
Re: SetDeviceGammaRamp funktioniert nicht3.251ModeratorMartoeng14.06.11 20:30
Re: SetDeviceGammaRamp funktioniert nicht3.305dbmaxpayne15.06.11 08:18
Re: SetDeviceGammaRamp funktioniert nicht3.322ModeratorMartoeng15.06.11 11:32
Re: SetDeviceGammaRamp funktioniert nicht3.348dbmaxpayne15.06.11 12:18
Re: SetDeviceGammaRamp funktioniert nicht3.235ModeratorMartoeng15.06.11 14:08
Re: SetDeviceGammaRamp funktioniert nicht3.290dbmaxpayne15.06.11 14:45
Re: SetDeviceGammaRamp funktioniert nicht3.283ModeratorMartoeng15.06.11 15:08
Re: SetDeviceGammaRamp funktioniert nicht3.381dbmaxpayne15.06.11 15:39
Re: SetDeviceGammaRamp funktioniert nicht3.319ModeratorMartoeng15.06.11 15:49

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2024 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel