UDF > GDIPlus > Graphics >


_GDIPlus_GraphicsSetSmoothingMode

Définit la qualité du rendu de l'objet graphique

#include <GDIPlus.au3>
_GDIPlus_GraphicsSetSmoothingMode ( $hGraphics, $iSmooth )

Paramètres

$hGraphics Handle de l'objet Graphics
$iSmooth Le mode de lissage:
    0 - Le lissage n'est pas appliquée
    1 - Le lissage est appliqué à l'aide d'un filtre à boîte 8 X 4
    2 - Le lissage est appliqué à l'aide d'un filtre à boîte 8 X 8

Valeur de retour

Succès: Retourne True.
Échec: Retourne False et définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*).

Remarque

Le filtre de lissage appliqué à l'aide d'un filtre à boîte 8 X 8 requiert au minimum le système d'exploitation Windows Vista.

En relation

_GDIPlus_GraphicsGetSmoothingMode

Voir aussi

Consultez GdipSetSmoothingMode dans la Librairie MSDN.

Exemple

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

Example()

Func Example()
    Local $hGUI = GUICreate("GDI+ test", 640, 480)
    GUISetState(@SW_SHOW)

    _GDIPlus_Startup()
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hPen = _GDIPlus_PenCreate()
    _GDIPlus_GraphicsDrawLine($hGraphics, 40, 40, 600, 440, $hPen) ; Trace une ligne de test pour montrer l'effet de lissage (par défaut pas de lissage)
    MsgBox($MB_SYSTEMMODAL, "", "Smoothing enabled: " & _GDIPlus_GraphicsGetSmoothingMode($hGraphics))

    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Installe le mode de lissage (8 X 4 boîte filtre)
    _GDIPlus_GraphicsDrawLine($hGraphics, 600, 40, 40, 440, $hPen) ; Trace une ligne de test pour montrer l'effet de lissage

    MsgBox($MB_SYSTEMMODAL, "", "Smoothing enabled: " & _GDIPlus_GraphicsGetSmoothingMode($hGraphics))

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE 

    ; Nettoie
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example