Crée un objet Effect qui agit sur teinte/saturation/luminosité
#include <GDIPlus.au3>
_GDIPlus_EffectCreateHueSaturationLightness ( [$iHueLevel = 0 [, $iSaturationLevel = 0 [, $iLightnessLevel = 0]]] )
$iHueLevel | [optionnel] Entier compris entre -180 et 180 qui spécifie la variation de teinte. |
$iSaturationLevel | [optionnel] Entier compris entre -180 à 180 qui spécifie la variation de la saturation. |
$iLightnessLevel | [optionnel] Entier compris entre -180 et 180 qui spécifie la variation de luminosité. |
Succès: | Retourne le handle de l'objet Effect. |
Échec: | Retourne 0 et définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
@error: | -1 - GDIPlus.dll ne supporte pas cette fonction. 10 - Paramètres invalides. |
Lorsque vous en avez terminé avec l'objet Effect, appelez _GDIPlus_EffectDispose() pour libérer les ressources.
_GDIPlus_EffectCreate, _GDIPlus_EffectDispose
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> _Example() Func _Example() If Not _GDIPlus_Startup() Or @extended < 6 Then MsgBox($MB_SYSTEMMODAL, "ERROR", "GDIPlus.dll v1.1 not available") Return EndIf Local $sFile = FileOpenDialog("Select an image", "", "Images (*.bmp;*.png;*.jpg;*.gif;*.tif)") If @error Or Not FileExists($sFile) Then Return Local $hImage = _GDIPlus_ImageLoadFromFile($sFile) Local $iWidth = 600 Local $iHeight = _GDIPlus_ImageGetHeight($hImage) * 600 / _GDIPlus_ImageGetWidth($hImage) Local $hGui = GUICreate("GDI+ v1.1 (" & @ScriptName & ")", $iWidth, $iHeight) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) GUISetState(@SW_SHOW) Local $hEffect = _GDIPlus_EffectCreateHueSaturationLightness(20, -60) If Not _GDIPlus_BitmapApplyEffect($hImage, $hEffect) Then MsgBox(0, "Error", "Effect not Applied") _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, $iWidth, $iHeight) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_EffectDispose($hEffect) _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() EndFunc ;==>_Example