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