UDF > GDIPlus > Graphics >


_GDIPlus_GraphicsSetInterpolationMode

D�finit le mode d'interpolation d'un objet graphique

#include <GDIPlus.au3>
_GDIPlus_GraphicsSetInterpolationMode ( $hGraphics, $iInterpolationMode )

Param�tres

$hGraphics Handle de l'objet Graphics
$iInterpolationMode Mode d'interpolation:
    0 - Mode d'interpolation par d�faut
    1 - Mode basse qualit�
    2 - Mode haute qualit�
    3 - Interpolation bilin�aire. Aucun pr�-filtrage n'est effectu�
    4 - Interpolation bicubique. Aucun pr�-filtrage n'est effectu�
    5 - Interpolation proximale (plus proche voisin)
    6 - Haute qualit�, interpolation bilin�aire. Pr�filtrage effectu� pour assurer la haute qualit� d'un r�tr�cissement d'image
    7 - de haute qualit�, interpolation bicubique. Pr�filtrage effectu� pour assurer la haute qualit� d'un r�tr�cissement d'image

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 mode d'interpolation d�termine l'algorithme qui est utilis� lorsque des images sont redimensionn�es ou tourn�es par une rotation

En relation

_GDIPlus_GraphicsGetInterpolationMode

Voir aussi

Consultez GdipSetInterpolationMode dans la Librairie MSDN.

Exemple

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

Example()

Func Example()
    _GDIPlus_Startup()
    Local Const $iW = @DesktopWidth / 4, $iH = @DesktopHeight / 4
    Local $hGUI = GUICreate("GDI+ test", $iW, $iH, -1, 10)
    GUISetState(@SW_SHOW)

    Local $aIM[8] = ["Default", "Low Quality", "High Quality", "Bilinear", "Bicubic", "Nearest Neighbor", "High Quality Bilinear", "High Quality Bicubic"]

    Local $hHBmp = _ScreenCapture_Capture("", 0, 0, -1, -1) ; Cr�e un bitmap GDI en capturant l'ensemble du bureau
    Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ; Convertit le bitmap GDI en GDI+
    _WinAPI_DeleteObject($hHBmp) ; Lib�re la ressource du bitmap GDI car elle n'est plus utile

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Cr�e un objet Graphics � partir du handle de la fen�tre
    Local $iIM = _GDIPlus_GraphicsGetInterpolationMode($hGraphics)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) ; Dessine le bitmap captur�e dans la GUI avec le mode d'interpolation par d�faut du syst�me
    MsgBox($MB_SYSTEMMODAL, "", "Interpolation Mode initial: " & $aIM[$iIM])

    _GDIPlus_GraphicsSetInterpolationMode($hGraphics, $GDIP_INTERPOLATIONMODE_NearestNeighbor) ; change le mode d'interpolation
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) ; Dessine de nouveau le m�me bitmap mais avec un mode d'interpolation diff�rent
    $iIM = _GDIPlus_GraphicsGetInterpolationMode($hGraphics)
    MsgBox($MB_SYSTEMMODAL, "", "Interpolation Mode after: " & $aIM[$iIM])

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE 

    ; Nettoie
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example