Funktionreferenz


_GDIPlus_EffectCreateColorMatrix

Beschreibung anzeigen in

Erstellt ein Effektobjekt der Klasse ColorMatrixEffect

#include <GDIPlus.au3>
_GDIPlus_EffectCreateColorMatrix ( $tColorMatrix )

Parameter

$tColorMatrix ColorMatrix Struktur.

Rückgabewert

Erfolg: Das Handle des Effect Objekts.
Fehler: 0 und setzt @error Flag ungleich Null, @extended kann den GPSTATUS Fehlercode ($GPID_ERR* siehe GDIPlusConstants.au3) enthalten.
@error: -1 - GDIPlus.dll unterstützt diese Funktion nicht.
10 - Ungültiger Parameter.

Bemerkungen

Wenn das Effect-Objekt nicht mehr verwendet wird, die Ressourcen freigeben mit _GDIPlus_EffectDispose().

Verwandte Funktionen

_GDIPlus_ColorMatrixCreate, _GDIPlus_ColorMatrixCreateGrayScale, _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 $tColorMatrix = _GDIPlus_ColorMatrixCreateGrayScale()

    Local $hEffect = _GDIPlus_EffectCreateColorMatrix($tColorMatrix)
    _GDIPlus_BitmapApplyEffect($hImage, $hEffect)

    _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