Multiplie chaque point d'un tableau par une matrice
#include <GDIPlus.au3>
_GDIPlus_MatrixTransformPoints ( $hMatrix, ByRef $aPoints )
$hMatrix | Handle de l'objet Matrix |
$aPoints | Tableau de points à transformer: [0][0] - Nombre de points [1][0] - Point 1, coordonnée X [1][1] - Point 1, coordonnée Y [2][0] - Point 2, coordonnée X [2][1] - Point 2, coordonnée Y [n][0] - Point n, coordonnée X [n][1] - Point n, coordonnée Y |
Succès: | Retourne True. |
Échec: | Retourne False et définit @error <> 0, @extended contient le code erreur ($GPID_ERR*). |
Chaque point du tableau est considéré comme une matrice ligne.
La multiplication est effectuée avec la matrice ligne à gauche et de la matrice carrée à droite.
Consultez GdipTransformMatrixPoints dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() ; Crée une GUI Local $aGui[6] Local $aPoints[6][2] = [[5]] For $i = 1 To 5 $aPoints[$i][0] = Cos(6.28 * $i / 5) * @DesktopHeight / 3 + @DesktopWidth / 2 $aPoints[$i][1] = Sin(6.28 * $i / 5) * @DesktopHeight / 3 + @DesktopHeight / 2 $aGui[$i] = GUICreate($i, 120, 100, $aPoints[$i][0] - 60, $aPoints[$i][1] - 50) GUISetBkColor(0x55) GUISetState(@SW_SHOW) Next _GDIPlus_Startup() Local $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, -@DesktopWidth / 2, -@DesktopHeight / 2) _GDIPlus_MatrixRotate($hMatrix, 1, True) _GDIPlus_MatrixTranslate($hMatrix, @DesktopWidth / 2, @DesktopHeight / 2, True) ; Boucle jusqu'à ce que l'utilisateur quitte. Local $iTimer = TimerInit() Do If TimerDiff($iTimer) > 40 Then _GDIPlus_MatrixTransformPoints($hMatrix, $aPoints) For $i = 1 To 5 WinMove($aGui[$i], "", $aPoints[$i][0] - 60, $aPoints[$i][1] - 50) Next $iTimer = TimerInit() EndIf Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_Shutdown() EndFunc ;==>Example