Funktionreferenz


_GDIPlus_EffectCreateHueSaturationLightness


Creates a HueSaturationLightness class effect object

#include <GDIPlus.au3>
_GDIPlus_EffectCreateHueSaturationLightness ( [$iHueLevel = 0 [, $iSaturationLevel = 0 [, $iLightnessLevel = 0]]] )

Parameter

$iHueLevel [optional] Integer in the range -180 through 180 that specifies the change in hue.
$iSaturationLevel [optional] Integer in the range -100 through 100 that specifies the change in saturation.
$iLightnessLevel [optional] Integer in the range -100 through 100 that specifies the change in lightness.

Rückgabewert

Success: a handle to an Effect object.
Failure: 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).
@error: -1 - GDIPlus.dll does not support this function.
10 - Invalid parameters.

Bemerkungen

When you are done with the Effect object, call _GDIPlus_EffectDispose() to release the resources.

Verwandte Funktionen

_GDIPlus_EffectCreate, _GDIPlus_EffectDispose

Beispiel

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>

_Example()

Func _Example()
    If Not _GDIPlus_Startup() Or @extended < 6 Then
        MsgBox($MB_SYSTEMMODAL, "FEHLER", "GDIPlus.dll v1.1 ist nicht verfügbar")
        Return
    EndIf

    Local $sFile = FileOpenDialog("Bitte ein Bild auswählen", "", "Bilder (*.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, "FEHLER", "Effekt nicht angewandt")

    _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