UDF > GDIPlus > Matrix >


_GDIPlus_MatrixMultiply

Remplace les coefficients d'une matrice par les coefficients du produit d'elle-même avec une autre matrice

#include <GDIPlus.au3>
_GDIPlus_MatrixMultiply ( $hMatrix1, $hMatrix2 [, $iOrder = 0] )

Paramètres

$hMatrix1 Handle de l'objet Matrix
$hMatrix2 Handle de l'objet Matrix qui sera multiplié par la première matrice
$iOrder [optionnel] Ordre de multiplication des matrices:
    0 - La seconde matrice est à gauche
    1 - La seconde matrice est à droite

Valeur de retour

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

Voir aussi

Consultez GdipMultiplyMatrix dans la Librairie MSDN.

Exemple

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

Example()

Func Example()
    Local $hGUI, $hGraphic, $hPen, $hPath, $hMatrix_Scale, $hMatrix_Clone, $hMatrix_Rotate

    ; Crée une GUI
    $hGUI = GUICreate("GDI+", 600, 600)
    GUISetState(@SW_SHOW)

    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Crée un objet graphique à partir du handle de la fenêtre
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Définit pour l'objet graphique la qualité de rendu antialiasing
    _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

    $hPen = _GDIPlus_PenCreate(0xFFFFBB00, 2)

    $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddArc($hPath, 0, 0, 600, 600, 0, 45)

    $hMatrix_Scale = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix_Scale, -300, -300)
    _GDIPlus_MatrixScale($hMatrix_Scale, 0.9, 0.9, True)

    $hMatrix_Rotate = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixRotate($hMatrix_Rotate, 40, True)

    For $i = 1 To 32
        $hMatrix_Clone = _GDIPlus_MatrixClone($hMatrix_Scale)
        _GDIPlus_MatrixMultiply($hMatrix_Clone, $hMatrix_Rotate, 1)
        _GDIPlus_MatrixTranslate($hMatrix_Clone, 300, 300, True)

        _GDIPlus_PathTransform($hPath, $hMatrix_Clone)
        _GDIPlus_MatrixDispose($hMatrix_Clone)

        _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen)
    Next

    ; Boucle jusqu'à ce que l'utilisateur quitte.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Nettoie les ressources
    _GDIPlus_MatrixDispose($hMatrix_Rotate)
    _GDIPlus_MatrixDispose($hMatrix_Scale)
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example