UDF > GDIPlus > Bitmap >


_GDIPlus_BitmapApplyEffectEx

Modifie un bitmap en appliquant un effet sp�cifi�

#include <GDIPlus.au3>
_GDIPlus_BitmapApplyEffectEx ( $hBitmap, $hEffect [, $iX = 0 [, $iY = 0 [, $iW = 0 [, $iH = 0]]]] )

Param�tres

$hBitmap Handle du bitmap auquel l'effet est appliqu�.
$hEffect Handle de l'effet � appliquer.
$iX [optionnel] La coordonn�e X du coin sup�rieur gauche de la partie � laquelle l'effet est appliqu�.
$iY [optionnel] La coordonn�e Y du coin sup�rieur gauche de la partie � laquelle l'effet est appliqu�.
$iW [optionnel] Sp�cifie la largeur de la partie � laquelle l'effet est appliqu�.
$iH [optionnel] Sp�cifie la hauteur de la partie � laquelle l'effet est appliqu�.

Valeur de retour

Succ�s: Retourne True.
�chec: Retourne False et d�finit @error <> 0, @extended contient le code erreur ($GPID_ERR*).
@error: -1 - GDIPlus.dll ne supporte pas cette fonction.
10 - Param�tres invalides.

Remarque

Passez 0 dans les param�tres des coordonn�es pour sp�cifier que l'effet s'applique au bitmap d'entr�e entier (par d�faut).

En relation

_GDIPlus_BitmapApplyEffect, _GDIPlus_EffectCreate

Exemple

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

_Example()

Func _Example()
    If Not _GDIPlus_Startup() Then
        MsgBox($MB_SYSTEMMODAL, "ERROR", "GDIPlus.dll v1.1 not available")
        Return
    EndIf

    Local $sFile = FileOpenDialog("Choisissez une image", "", "Images (*.bmp;*.png;*.jpg;*.gif;*.tif)")
    If @error Or Not FileExists($sFile) Then Return

    Local $hImage = _GDIPlus_ImageLoadFromFile($sFile)
    Local $iImgW = _GDIPlus_ImageGetWidth($hImage)
    Local $iImgH = _GDIPlus_ImageGetHeight($hImage)

    Local $iWidth = 600
    Local $iHeight = $iImgH * 600 / $iImgW

    Local $hGui = GUICreate("GDI+ v1.1", $iWidth, $iHeight)
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    GUISetState(@SW_SHOW)

    Local $hEffect = _GDIPlus_EffectCreateHueSaturationLightness(0, -100, 0)
    _GDIPlus_BitmapApplyEffectEx($hImage, $hEffect, $iImgW * 0.25, $iImgH * 0.25, $iImgW * 0.5, $iImgH * 0.5)

    _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