{>>DETERMINATION DE LA LUMINOSITE} Function FindActualGamma : integer; var hGammaDC : HDC; GammaArray: array[0..2,0..255] of word; begin hGammaDC := GetDC(0); GetDeviceGammaRamp(hGammaDC, GammaArray); ReleaseDC(0, hGammaDC); result:=GammaArray[0,1]-128; end; {>>MODIFICATION DE LA LUMINOSITE } Procedure ChangeLuminosity(Brightness: integer); var hGammaDC : HDC; GammaArray: array[0..2] of array [0..255] of word; Index, ArrayValue: integer; begin hGammaDC := GetDC(0); for Index := 0 to 255 do begin ArrayValue := Index * (Brightness + 128); if (ArrayValue > 65535) then ArrayValue := 65535; GammaArray[0,Index] := WORD(ArrayValue); GammaArray[1,Index] := WORD(ArrayValue); GammaArray[2,Index] := WORD(ArrayValue); end; SetDeviceGammaRamp(hGammaDC, GammaArray); ReleaseDC(0, hGammaDC); end; {>>DIMINUTION DE LA LUMINOSITE} procedure TForm1.DownLuminosity_Bt(Sender: TObject); Var i,ActualGamma : integer; Begin ActualGamma:=FindActualGamma; For i:=ActualGamma downto 64 do ChangeLuminosity(i); end; {>>AUGMENTATION DE LA LUMINOSITE} procedure TForm1.UpLuminosity_Bt(Sender: TObject); Var i,ActualGamma : integer; Begin ActualGamma:=FindActualGamma; For i:=ActualGamma to 128 do ChangeLuminosity(i); end;
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.