GDI+ Rotation Matrix

06/21/2013 22:04 Croco™#1
Hi,
ich bin seit einer gefühlten Ewigkeit daran, etwas extrem banales zu schaffen.
Und zwar will ich ein .png um eine bestimmte Anzahl an Grad drehen.
Ich habe zwar bis jetzt die Rotations Matrix gefunden nur finde Leider keine Beispiele bei der das gedrehte Bild gezeichnet wird, sondern nur welche, bei denen es gespeichert wird. Könnt ihr mir einen kleinen Wink geben ?

Edit: Problem gelöst
Quote:
#include <GDIPlus.au3>
#include <Misc.au3>
#include <WindowsConstants.au3>


_GDIPlus_Startup()


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

$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGui)
$hImage = _GDIPlus_ImageLoadFromFile("Enemy.png")
$iWidth = _GDIPlus_ImageGetWidth($hImage) * 96 / _GDIPlus_ImageGetVerticalResolution($hImage)
$iHeight = _GDIPlus_ImageGetHeight($hImage) * 96 / _GDIPlus_ImageGetHorizontalResolution($hImage)
$hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, 400, 300)
_GDIPlus_MatrixRotate($hMatrix, 45, "False")
_GDIPlus_GraphicsSetTransform($hGraphic, $hMatrix)
_GDIPlus_GraphicsClear($hGraphic)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, -$iWidth / 2, -$iHeight / 2)

While 1
Sleep(200)
WEnd