Function Reference


Updates a matrix with the product of itself and another matrix

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


$hMatrix1 Pointer to a Matrix object
$hMatrix2 Pointer to a Matrix object that will be multiplied by the first matrix
$iOrder [optional] Order of matrices multiplication:
    0 - The second matrix is on the left
    1 - The second matrix is on the right

Return Value

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).

See Also

Search GdipMultiplyMatrix in MSDN Library.


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


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

    ; Create GUI
    $hGUI = GUICreate("GDI+", 600, 600)

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (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_GraphicsDrawPath($hGraphic, $hPath, $hPen)

    ; Loop until the user exits.
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
EndFunc   ;==>Example