Nach GDIPlus_Matrix_Dispose wird die Linie immer noch gedreht dargestellt????

  • Hallo,
    Nach GDIPlus_Matrix_Dispose wird die Linie immer noch gedreht dargestellt?
    Wie komme ich denn in die normale Matrix, bzw. meine normale Grafik zurück, in der ich wieder senkrechte Linien usw. zeichnen kann?

    Spoiler anzeigen

    #include <GDIPlus.au3>

    _GDIPlus_Startup()

    $hGui = GUICreate("Test Rotate",600,600)
    GUISetState()

    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)

    $iARGB_BG=0xFFFFFFFF
    _GDIPlus_GraphicsClear($hGraphic, $iARGB_BG)

    $iWidth = 100
    $iHeight = 200

    $hMatrix = _GDIPlus_MatrixCreate()

    _GDIPlus_MatrixTranslate($hMatrix, 400, 0)

    _GDIPlus_MatrixRotate($hMatrix, 40, "False")

    _GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)

    $hpen = _GDIPlus_PenCreate (0xff11FF33,1) ;Stiftfarbe
    _GDIPlus_GraphicsDrawEllipse($hGraphic, $iWidth, $iHeight, $iWidth/2, $iHeight*2,$hPen)

    _GDIPlus_MatrixDispose($hMatrix)

    $hpen2 = _GDIPlus_PenCreate (0xFF000000,1) ;Stiftfarbe
    _GDIPlus_GraphicsDrawline($hGraphic,300,0,300,600,$hpen2)


    While GUIGetMsg() <> -3
    Sleep(10)
    WEnd

    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

    Beste Grüße, Jens

    Einmal editiert, zuletzt von Trubadour (1. Oktober 2013 um 19:16)

  • Nach _MatrixDispose() fügst du folgendes hinzu:

    [autoit]


    $hMatrix = _GDIPlus_MatrixCreate() ;Erstelle eine Identitätsmatrix
    _GDIPlus_GraphicsSetTransform($hGraphics, $hMatrix) ;Setze die Identitätsmatrix
    _GDIPlus_MatrixDispose($hMatrix) ;Der Graphics-Context merkt sich die gesetzte Matrix, daher wird diese nun freigegeben.

    [/autoit]

    Einmal editiert, zuletzt von CentuCore (1. Oktober 2013 um 22:20)